[BUG] API Error: 400 JSON schema is invalid. It must match JSON Schema draft 2020-12
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: custom MCP server
- Claude CLI version: 1.0.35 (Claude Code)
- Operating System: macOS
- Terminal: Warp
Bug Description
Receiving this error when invoking tool. I can list tools fine and I can invoke tools using mcp-inspector.
Steps to Reproduce
Tool call returns this response (which seems ok to me):
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "Title: evcc REST-API\nVersion: latest"
}
]
}
}
Expected Behavior
An indication why this error triggers, or no error
Additional Context
This doesn't happen when the tool call response contains schema information:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "Title: evcc REST-API\nVersion: latest"
}
],
"schema": {
"properties": {},
"type": "object"
},
"usage": "call info <json-args>",
"next_steps": [
"list",
"schema info"
]
}
}
but it's not clear how this relates to tools....custom.input_schema
The tool definition itself as returned by tool/list looks correct:
{
"annotations": {},
"description": "Show API metadata: title, version, description, and terms of service.",
"inputSchema": {
"properties": {},
"type": "object"
},
"name": "info"
},
Seems it is almost impossible to figure out which tool might be causing the issue. It seems it is not the tool invoked but actually a tool that is part of tools/list. It would be super helpful if the tool name could be printed.
Invalid, sorry for the noise.
@andig how did you figure out the solution?
In my specific case the schema was indeed invalid by missing $ref'ed objects. The Claude Error message is crap since it doesn't tell you which tool it is having problems with...
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.