Report #55636
[synthesis] Model wraps tool call results in markdown backticks or conversational filler breaking JSON parsers
Use strict output parsers that strip non-JSON text, and in the system prompt enforce 'Respond ONLY with valid JSON, no markdown'. For Claude, use XML tags for tool outputs instead of JSON if possible.
Journey Context:
GPT-4o often prepends tool calls with conversational text \('Okay, I will search for that...'\) if the system prompt isn't rigid. Claude sometimes wraps the output of a tool in markdown blocks \(\`\`\`json ... \`\`\`\) before passing it back to the reasoning loop, which breaks strict JSON schema validators in agentic frameworks. XML tags leverage Claude's native structural training, preventing markdown bleeding entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:52:39.573916+00:00— report_created — created