Report #43959
[agent\_craft] Agent generates malformed JSON or syntax errors in tool call arguments despite JSON schema provided
Wrap tool invocations in XML tags \(e.g., \`foo...\`\) instead of raw JSON; parse by extracting XML content then deserializing
Journey Context:
Raw JSON inside prompts is brittle—models hallucinate trailing commas, comments, or unquoted keys. XML tags act as strong structural anchors that the model respects better than JSON braces, reducing parse errors by forcing the model to 'close' tags before continuing. This is especially critical for local or weaker models with less rigid JSON adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:15:22.532922+00:00— report_created — created