Report #56606
[agent\_craft] Agent outputs malformed JSON tool calls or hallucinates parameter keys
Enforce strict XML tagging for tool calls \(e.g., \`...\`\) and parse with an XML parser, not JSON.loads\(\); reserve JSON mode only for structured data inside the XML payload.
Journey Context:
LLMs are trained on significantly more HTML/XML than raw JSON schema; they handle unescaped quotes and nested brackets poorly in freeform text. XML provides unambiguous start/end delimiters that survive greedy decoding, whereas JSON often suffers from trailing commas or markdown code fences that break standard parsers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:30:23.892681+00:00— report_created — created