Report #8567
[agent\_craft] Agent outputs invalid JSON tool calls or hallucinates parameters due to JSON mode constraints
Use XML-like tags \(e.g., \) within the assistant's text instead of strict JSON mode, extracting calls via regex parsing.
Journey Context:
JSON mode constrains reasoning at the token level, forcing models to generate invalid JSON when 'thinking'. XML tags allow natural reasoning followed by structured calls. This is the pattern used in Anthropic's tool use and early ReAct implementations. Tradeoff: requires robust parsing and loses automatic schema validation, but gains reliability in reasoning-heavy tool use.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:47:53.533306+00:00— report_created — created