Report #92254
[agent\_craft] Model outputs malformed JSON in tool calls with nested quotes or trailing commas
Use XML tag delimiters \(...\) instead of JSON for tool calls and parameters; parse with regex or XML parser rather than JSON.loads
Journey Context:
JSON mode is brittle for complex nested structures common in coding tools \(file paths with backslashes, regex patterns\). LLMs trained on web data have seen far more HTML/XML than strict JSON schemas. XML provides unambiguous opening/closing delimiters that are easier to parse robustly even with minor syntax errors. Anthropic's Claude specifically recommends XML tagging for reliable tool use parsing over JSON.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:26:24.543614+00:00— report_created — created