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
{{ message }}
Repository navigation
Schema validation error with Google/Gemini models #8036
When using OpenCode with Google Gemini models, I'm encountering a 400 validation error related to the memory_rate_memory tool's schema.
Error Message
Invalid value at 'request.tools[0].function_declarations[33].parameters.properties[1].value.enum[0]' (TYPE_STRING), -1
Invalid value at 'request.tools[0].function_declarations[33].parameters.properties[1].value.enum[1]' (TYPE_STRING), 0
Invalid value at 'request.tools[0].function_declarations[33].parameters.properties[1].value.enum[2]' (TYPE_STRING), 1
Details
The memory_rate_memory tool (from the mcp-memory-service MCP server) defines its rating parameter with numeric enum values:
When OpenCode passes this tool definition to the Google/Gemini API, the API rejects it with a 400 error, indicating it expects string enum values instead of numeric ones.
Context
mcp-memory-service is a popular, actively maintained MCP server (1.1k+ stars, Apache 2.0 licensed)
It's compatible with 13+ AI applications including Claude Desktop, Claude Code, VS Code, Cursor, etc.
The tool appears to work correctly with other model providers (OpenAI, Anthropic, etc.)
This issue appears specific to Google/Gemini's stricter API validation requirements
Environment
OpenCode version: latest
Model: gemini-3-pro-low
Platform: Linux
Additional Context
The error occurs when trying to use tools from mcp-memory-service with Google Gemini models in OpenCode. Other model providers seem to accept the same tool schema without issues.
Both issues describe the same root cause - the memory_rate_memory tool has numeric enum values [-1, 0, 1] for the rating parameter, but Google/Gemini (and anti-gravity) models require enum values to be strings instead. The error messages are identical.
Feel free to ignore if this is a different use case.
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
Both issues describe the same root cause - the
memory_rate_memorytool has numeric enum values[-1, 0, 1]for theratingparameter, but Google/Gemini (and anti-gravity) models require enum values to be strings instead. The error messages are identical.Feel free to ignore if this is a different use case.
fix(provider): strip properties/required from non-object types in Gem…