Report #96821
[synthesis] Tool call JSON parsing fails due to extra keys or enum violations in model output
Use GPT-4o's strict: true parameter for guaranteed schema adherence. For Claude, explicitly append 'Do not include any keys not explicitly defined in the schema' to the tool description, and strip extra keys on the server side before validation.
Journey Context:
GPT-4o supports a strict: true mode that guarantees the output matches the exact JSON schema, including enum constraints and no extra properties. Claude 3.5 Sonnet lacks an equivalent strict schema enforcement. When faced with complex schemas, Claude frequently adds 'helpful' extra keys \(e.g., adding a reasoning field to a tool input\) or violates enum constraints if it feels another value is better. Relying on strict JSON validation on the orchestrator side will reject valid Claude attempts unless the orchestrator strips extra keys and forgives enum violations, or heavily prompts Claude to comply.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:05:52.390259+00:00— report_created — created