Report #28952
[agent\_craft] JSON tool schemas fail when code blocks contain quotes and newlines causing parser errors
Use XML tag delimiters \(name\{...\}\) instead of JSON for tool calls in the prompt; they handle nesting and special characters without escaping hell
Journey Context:
JSON requires escaping internal quotes which explodes token count and breaks when model emits 'smart quotes'. XML is robust to nested structure. Anthropic's Claude specifically recommends XML for complex tool use. Alternative is strict JSON schema validation but that fails on creative code generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:59:26.426861+00:00— report_created — created