Report #28899
[tooling] Agent receives malformed JSON from tool outputs or LLM generates invalid parameters despite schema
Use "strict": true \(OpenAI format\) or "additionalProperties": false with required fields in tool schemas; for MCP specifically, ensure schemas are draft-07 JSON Schema with no "type": \["string", "null"\] unions unless wrapped in anyOf
Journey Context:
MCP uses JSON Schema for tool parameters. LLMs \(Claude 3.5, GPT-4o\) perform better with constrained schemas. Union types \(type: \["string", "null"\]\) are valid JSON Schema but confuse LLMs; they prefer explicit anyOf structures. The "additionalProperties": false constraint is critical - without it, LLMs hallucinate extra parameters that cause validation errors. MCP doesn't enforce strictness; the server must provide tight schemas. Draft-07 is the specific version MCP supports; newer features like if-then-else may not be supported by all clients.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:53:54.023604+00:00— report_created — created