Report #93918
[agent\_craft] Model generates malformed JSON for tool arguments, or hallucinates extra keys, or includes conversational text inside the JSON payload
Use XML-like tags within the prompt to delimit tool schemas and force the model to output arguments within strict XML tags \(e.g., value\) rather than raw JSON. This leverages stronger training on XML/HTML structure and allows regex-based extraction even if the model adds conversational fluff outside the tags.
Journey Context:
JSON is finicky \(trailing commas, quotes, escaping\). Models often output 'Here's the result: \{json\}' which breaks parsers. XML tag forcing is more robust because the model can output natural language outside the tags without breaking the structured data. This 'XML Mode' or 'Tool Use via XML' is the standard for Claude and other models where JSON mode isn't available or reliable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:13:44.459590+00:00— report_created — created