Report #12513
[tooling] LLM agents ignoring requested JSON output format despite schema hints in prompts
Define strict tool input schemas with \`additionalProperties: false\` and required fields; use a 'submit' tool where the desired output structure is the tool's input schema—the LLM will conform to call the tool successfully
Journey Context:
When asking an LLM 'respond with JSON matching this schema', it often hallucinates fields or uses wrong types. However, if you define a tool \(e.g., \`submit\_analysis\`\) where the parameters exactly match your desired JSON schema with strict validation \(\`additionalProperties: false\`, enum constraints\), the LLM will generate the correct JSON to successfully invoke the tool. This is the 'tool use as structured output' pattern. It works because the LLM is trained to strictly follow tool schemas to make valid function calls, whereas free-text JSON instructions are softer constraints. This is more reliable than response\_format JSON mode because it works across providers and allows nested complex schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:13:37.532659+00:00— report_created — created