Error with Gemini models when MCP enabled
Description
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
Screenshot and/or share link
This is the error block:
* GenerateContentRequest.tools[0].function_declarations[21].parameters.properties[nodes].items: missing field.
* GenerateContentRequest.tools[0].function_declarations[21].parameters.properties[edges].items: missing field.
Operating System
macOS 26.1
Terminal
Ghostty, Tmux
This issue might be a duplicate of existing issues. Please check:
- #4665: OpenCode plus Zen Gemini 3 Pro model causes errors (similar GenerateContentRequest validation errors with Gemini)
- #3140: AI_APICallError with function declarations parameters on Gemini API (exact same schema validation error pattern)
- #4832: Gemini 3 Pro function calling fails - missing
thoughtSignaturesupport (related to Gemini function calling issues) - #365: [bug] google provider not running due to tool call schema mismatches (broader Gemini schema mismatch issue)
Feel free to ignore if none of these address your specific case.
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?
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
}
}
}
okay ill try to make transform more robust for that case