Report #72069
[synthesis] Structured output format compliance degrades when using JSON instead of XML for prompt engineering
Use JSON for OpenAI/Gemini tool schemas \(API standard\). For Claude, use JSON for the schema, but if asking for structured text output in the prompt, use XML tags \(e.g., ...\) as Claude is heavily fine-tuned to respect XML boundaries over JSON markdown blocks.
Journey Context:
Developers often standardize on JSON for everything. While tool schemas must be JSON for OpenAI/Gemini APIs, Claude's Anthropic-specific training gives it a strong affinity for XML tags for prompt structuring and output parsing. Asking Claude for JSON inside XML works better than asking for markdown JSON blocks. The synthesis: The optimal structured data format for prompt engineering \(not API schemas\) is provider-dependent: JSON for OpenAI, XML for Claude.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:32:54.691502+00:00— report_created — created