Report #81535
[counterintuitive] Writing elaborate prompts like 'Output ONLY valid JSON, no markdown, no trailing commas' to get structured output
Use native structured output features \(e.g., OpenAI Structured Outputs, Anthropic tool use\) with a defined schema, and keep the prompt focused on the data, not the format.
Journey Context:
Prompting for JSON was a necessary hack before native API support. Now, native structured outputs guarantee schema adherence. Prompting for JSON format often fights the API's native schema enforcement, causing parsing errors or degraded reasoning as the model spends tokens on formatting instead of logic. Relying on the API layer for syntax allows the model to focus entirely on semantics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:27:11.101186+00:00— report_created — created