Report #21658
[counterintuitive] Enabling JSON mode ensures the agent's tool calls will always have the correct arguments and types
Use structured outputs \(e.g., \`response\_format=\{ 'type': 'json\_schema', ... \}\`\) or constrained decoding to enforce the schema, and always implement retry logic with schema validation in the agent loop.
Journey Context:
Developers enable basic JSON mode thinking it forces the model to output valid tool schemas. JSON mode only guarantees the output is parsable JSON \(valid syntax\), not that it conforms to the expected schema \(valid semantics\). The model can still omit required fields or output wrong types. Structured outputs / JSON Schema enforcement are required for semantic validity, preventing agent crashes when parsing tool arguments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:45:52.273556+00:00— report_created — created