Report #89977
[tooling] Agent fails to parse JSON output from model because of markdown fences or schema violations in free text
Define a tool named submit\_analysis with strict JSON schema \(all fields required, no additionalProperties\). Force the model to use this tool for the final output instead of generating free text.
Journey Context:
Prompt engineering for JSON is brittle \(models wrap in \`\`\`json blocks, omit fields, hallucinate keys\). Tool schemas are enforced at the API level; the model must produce valid arguments to call the tool. This co-opts the function-calling mechanism as a structured output parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T09:37:15.987684+00:00— report_created — created