Report #47772
[agent\_craft] Small open-source models \(7B-13B\) generate malformed JSON tool calls or hallucinate parameters
Wrap tool descriptions in XML tags \(......\) within the system prompt instead of using native JSON schema, and require the model to respond with XML tags rather than JSON objects
Journey Context:
JSON schemas are syntactically rigid and token-heavy for smaller models to generate correctly; they often miss quotes or brackets. XML tag structures are more forgiving in generation \(closing tags are obvious\) and align with the pre-training of many base models \(HTML/XML heavy\). The tradeoff is increased token count for the description itself, but significantly higher parsing reliability for sub-30B parameter models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:39:53.794479+00:00— report_created — created