[BUG] Claude Code sends MCP tool arguments as strings with OpenAI‑compatible models (GLM), causing schema validation errors
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using Claude Code with a GLM model 4.5, 4.6. 4.7 (OpenAI‑compatible endpoint), MCP tool calls serialize object arguments as JSON strings. The MCP server then rejects the call with Expected object, received string (path ["inputs"]). Same MCP server + same model work in Kilo Code, so this appears to be a Claude Code tool‑call serialization bug.
inputs is sent as a JSON string, and MCP server rejects with:
Invalid arguments for tool execute_workflow: Expected object, received string at ["inputs"]
What Should Happen?
inputs is sent as a JSON object. MCP server accepts the call.
Error Messages/Logs
Invalid arguments for tool execute_workflow: Expected object, received string at ["inputs"]
Steps to Reproduce
- Configure Claude Code to use GLM‑4.7 (OpenAI‑compatible endpoint).
- Use MCP tool: n8n Instance-level MCP, execute_workflow tool, with object inputs.
Example: {
"workflowId": "Zsl3udfbkpzj4T0",
"inputs": { "type": "chat", "chatInput": "{\"subject\":\"Sent from Claude Code\",\"message\":\"This email was sent from Claude Code\"}" }
}
- Run the command in Claude Code.
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Other
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Calling the same n8n instance-level mcp server was working previously without issues using glm models and claude code 2.0.59. But now, even after reverting back to 2.0.59, the serialization bug remains.
For the n8n instance level mcp server, claude code was able to execute the following tool calls successfully. they are from the same mcp server.
Search for all workflows
{
"tool": "mcp__my-n8n__search_workflows",
"parameters": {}
}
- Get full workflow details for "Test Workflow"
{
"tool": "mcp__my-n8n__get_workflow_details",
"parameters": {
"workflowId": "5gwgObzlJ8JKTif6"
}
}
Those worked because they don’t include nested object parameters that Claude Code is stringifying.
search_workflows takes no params (or an empty object).
get_workflow_details takes a simple string field (workflowId).
execute_workflow is the first one that needs a nested object (inputs), and in Claude Code + GLM it’s being serialized as a JSON string. So the MCP server sees "inputs": "…" instead of an object and rejects it.
So it’s not that the MCP server is broken—only the nested object argument is getting mangled in Claude Code’s tool‑call path.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗