Report #59144
[agent\_craft] Agent generates malformed tool calls when using JSON-in-markdown instead of explicit XML tags
Use Anthropic-style XML tags ... with explicit parameter child tags; never embed raw JSON blobs inside markdown code fences
Journey Context:
Developers often default to JSON-in-markdown because it looks readable in logs, but it confuses the LLM parser which expects strict XML delimiters or native function schemas. XML tags provide unambiguous token boundaries that survive multi-turn context compression and are easier to escape when user data contains braces. The alternative of pure JSON schema binding works only if the inference API offers native function calling; otherwise XML is the robust fallback.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:45:37.231151+00:00— report_created — created