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
[bug] Gemini API rejects MCP tool schemas with properties/required on non-object types #11889
When using MCP servers (e.g., Notion MCP) with Gemini models, the API returns a 400 error because some tool schemas have properties or required fields on non-object types.
Error Message
Bad Request: {
"error": {
"code": 400,
"message": "* GenerateContentRequest.tools[0].function_declarations[80].parameters.properties[data].properties: only allowed for OBJECT type
* GenerateContentRequest.tools[0].function_declarations[80].parameters.properties[data].required: only allowed for OBJECT type",
"status": "INVALID_ARGUMENT"
}
}
Steps to Reproduce
Enable Notion MCP (or other MCP servers with similar schema patterns)
Use a Gemini model (e.g., gemini-3-flash-preview)
Send any message
Error occurs on requests with larger tool sets
Expected Behavior
Tool schemas should be sanitized to remove properties and required from non-object types before sending to Gemini API.
Current Behavior
The sanitizeGemini function in transform.ts handles enum conversion and required field filtering, but doesn't strip properties/required from non-object types.
These issues all relate to the same root cause: Gemini API's strict validation that only allows properties and required fields on OBJECT type parameters.
Feel free to ignore if your specific case differs from these.
Activity
github-actions commentedon Feb 3, 2026
This issue might be a duplicate of existing issues. Please check:
These issues all relate to the same root cause: Gemini API's strict validation that only allows
propertiesandrequiredfields on OBJECT type parameters.Feel free to ignore if your specific case differs from these.