-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Labels
zenRelates to ZenRelates to Zen
Description
Problem
Gemini API rejects schemas containing $ref alongside other fields, causing errors like:
$ref 'QuestionOption' was set alongside unsupported fields.
If a schema node has $ref set, then only description and default can be set alongside it
This happens when MCP tools use JSON Schema with $ref references to $defs/definitions.
Expected Behavior
OpenCode should expand $ref references before sending schemas to Gemini API.
Related Issues
- Gemini API rejects MCP tool schemas with $defs references google-gemini/gemini-cli#13326 - Gemini API rejects MCP tool schemas with
$defsreferences - Error with Gemini models when MCP enabled #5832 - Error with Gemini models when MCP enabled
- Gemini Bad Request with Github Copilot #8417 - Gemini Bad Request with Github Copilot
Related PRs
- fix: apply schema transformation to MCP tools for Gemini compatibility #11968 - Applies schema transformation to MCP tools (complementary fix)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
zenRelates to ZenRelates to Zen