Report #75312
[synthesis] Model outputs raw XML tags around JSON tool calls, breaking JSON parsers
Use explicit output format instructions and avoid prompting techniques that encourage XML thinking \(like Chain of Thought\) in the same turn as strict JSON tool calling, unless the orchestrator strips XML.
Journey Context:
Claude is heavily trained on XML for structured outputs and cognitive scaffolding. When asked to 'think step by step' and then call a tool, Claude often wraps its JSON in \`\` XML tags or outputs XML thinking before the JSON. GPT-4o rarely does this, preferring markdown or raw JSON. If your parser expects strict JSON, Claude's XML injection will crash it. Either strip XML tags pre-parse, or separate the reasoning step into a distinct conversational turn from the tool execution step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:00:29.629596+00:00— report_created — created