You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to use opencode with any gemin models. Tried updating the API key multiple times, but that doesn't seem to be the root cause. Since the same API keys are woring in other apps. Not sure what the issue is?
OpenCode version
1.0.174
Steps to reproduce
Enable MCP
Select any Gemini model before starting the conversation
Looks like the issue was specific to the MCP configuration. I disabled all my MCPs (which were only 3) from ~/.config/opencode/opencode.json and tried using the Gemini model,s and it worked fine.
Although I am curious whether there is any fix for this?
ur mcp server isnt compatible w gemini api, now we do some transforms to make the tools compliant but there is a case we arent handling, what mcp causes this?
Hey everyone, I want to apologize - my initial testing for #11952 wasn't thorough enough and missed an important case.
What Happened
The fix in #11952 added nested array handling to sanitizeGemini, but MCP tools were bypassing the schema transformation pipeline entirely. This means MCP tools with 2D arrays (like google-docs-mcp spreadsheet tools, basic-memory, etc.) still failed with Gemini even after #11952 was merged.
> build · gemini-3-flash
Hello! How can I help you today?
The Fix
I've opened #11968 to address this. The fix ensures MCP tools go through ProviderTransform.schema() before registration, so the sanitizeGemini transformation is properly applied.
Affected MCP Tools
Any MCP tool with nested array schemas, including:
Activity
github-actions commentedon Dec 20, 2025
This issue might be a duplicate of existing issues. Please check:
thoughtSignaturesupport #4832: Gemini 3 Pro function calling fails - missingthoughtSignaturesupport (related to Gemini function calling issues)Feel free to ignore if none of these address your specific case.
shettydev commentedon Dec 20, 2025
Looks like the issue was specific to the MCP configuration. I disabled all my MCPs (which were only 3) from
~/.config/opencode/opencode.jsonand tried using the Gemini model,s and it worked fine.Although I am curious whether there is any fix for this?
[-]Not working with Gemini models[/-][+]Error with Gemini models when MCP enabled[/+]rekram1-node commentedon Dec 20, 2025
ur mcp server isnt compatible w gemini api, now we do some transforms to make the tools compliant but there is a case we arent handling, what mcp causes this?
shettydev commentedon Dec 21, 2025
I found the MCP, which is causing this issue:
{ "$schema": "https://opencode.ai/config.json", ... "mcp": { ... "basic-memory": { "type": "local", "command": ["basic-memory", "mcp"], "enabled": true } } }rekram1-node commentedon Dec 21, 2025
okay ill try to make transform more robust for that case
Molder72 commentedon Jan 24, 2026
same problem Gemini models with MCP jetbrains rider server not working
fix: handle nested array items for Gemini schema validation
mugnimaestra commentedon Feb 3, 2026
I've opened a PR to address the remaining edge cases for this issue: #11952
The fix extends #5846 to handle:
itemsitems: {}objects that lack a typeThis should resolve the
items.items: missing fielderrors when using Gemini with MCP tools like basic-memory and JetBrains Rider MCP server.mugnimaestra commentedon Feb 3, 2026
Follow-up: Additional Fix Required
Hey everyone, I want to apologize - my initial testing for #11952 wasn't thorough enough and missed an important case.
What Happened
The fix in #11952 added nested array handling to
sanitizeGemini, but MCP tools were bypassing the schema transformation pipeline entirely. This means MCP tools with 2D arrays (likegoogle-docs-mcpspreadsheet tools,basic-memory, etc.) still failed with Gemini even after #11952 was merged.Evidence
Testing with
google-docs-mcpenabled:With only #11952 (version
202602031444):With the follow-up fix (version
202602031607):The Fix
I've opened #11968 to address this. The fix ensures MCP tools go through
ProviderTransform.schema()before registration, so thesanitizeGeminitransformation is properly applied.Affected MCP Tools
Any MCP tool with nested array schemas, including:
google-docs-mcp:writeSpreadsheet,appendSpreadsheetRows,createSpreadsheetbasic-memory(as originally reported)Again, sorry for the incomplete fix. #11968 should fully resolve this issue for all MCP tools.