Remove invalid JSON schema in query gmail emails tool - #34
Conversation
Resolves this error returned by the OpenAI API:
{'error': {'message': \"Invalid schema for function 'google-suite__query_gmail_emails': False is not of type 'array'.\", 'type': 'invalid_request_error', 'param': 'tools[5].function.parameters', 'code': 'invalid_function_parameters'}
|
mh interesting. how does this affect Anthropic? |
|
With anthropic: I am using goose as my MCP client. |
|
I can confirm this issue affects Claude Code (Claude's official CLI) as well. When trying to use the mcp-gsuite server via Claude Code's stdio integration, I get the same schema validation error: After investigating, I found additional schema validation issues beyond the
While this PR fixes the immediate issue with the query tool, you might want to consider removing all
This would ensure full compatibility with Claude and other APIs that strictly validate against JSON Schema draft 2020-12. Thanks for the fix! The removal of |
…ails JSON Schema draft 2020-12 requires `required` to be an array at object level. A boolean inside a property is a draft-3 relic, and the Anthropic API rejects the whole request with 400 tools.N.custom.input_schema: JSON schema is invalid the moment this tool enters the tools array, hard-wedging the client session until it is cleared. Upstream has five open PRs for this same line (MarkusPfundstein#34, MarkusPfundstein#52, MarkusPfundstein#54, MarkusPfundstein#61) and has not shipped since 2025-04. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W2NqixEf6Ud6XM9XydfXN2
Resolves this error returned by the OpenAI API:
{'error': {'message': "Invalid schema for function 'google-suite__query_gmail_emails': False is not of type 'array'.", 'type': 'invalid_request_error', 'param': 'tools[5].function.parameters', 'code': 'invalid_function_parameters'}