Bug Report
Description
When using Gemini as the AI provider in OpenCode, every request fails with the following error:
Unable to submit request because `github_create_pull_request_review` functionDeclaration
`parameters.comments` schema specified other fields alongside any_of.
When using any_of, it must be the only field set.
Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling
Root Cause
Gemini API validates all tool schemas before processing any request.
The github_create_pull_request_review tool from @modelcontextprotocol/server-github
defines the comments parameter with anyOf combined with other fields (e.g. type, description, items).
Gemini strictly requires that when anyOf is used, it must be the only field in the schema object. No sibling fields allowed.
Impact
- ANY request to Gemini fails — not just GitHub-related ones
- The error appears even for simple questions like "hello"
- Makes Gemini completely unusable when the GitHub MCP server is enabled
Workaround
Disable the GitHub MCP server in opencode.json:
"github": {
"enabled": false
}
Expected Fix
OpenCode should sanitize tool schemas before sending them to Gemini. When a schema uses anyOf, strip all sibling fields:
// Before (breaks Gemini):
{ type: 'array', anyOf: [...], description: '...' }
// After (Gemini-compatible):
{ anyOf: [...] }
Reference: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling
Environment
- OpenCode with Gemini provider (via
opencode-gemini-auth plugin)
- GitHub MCP:
@modelcontextprotocol/server-github
- Platform: macOS
Bug Report
Description
When using Gemini as the AI provider in OpenCode, every request fails with the following error:
Root Cause
Gemini API validates all tool schemas before processing any request.
The
github_create_pull_request_reviewtool from@modelcontextprotocol/server-githubdefines the
commentsparameter withanyOfcombined with other fields (e.g.type,description,items).Gemini strictly requires that when
anyOfis used, it must be the only field in the schema object. No sibling fields allowed.Impact
Workaround
Disable the GitHub MCP server in
opencode.json:Expected Fix
OpenCode should sanitize tool schemas before sending them to Gemini. When a schema uses
anyOf, strip all sibling fields:Reference: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling
Environment
opencode-gemini-authplugin)@modelcontextprotocol/server-github