Report #39348
[agent\_craft] Agent produces malformed tool calls when using complex nested arguments
Wrap tool definitions in hierarchical XML tags \(...\) rather than flat JSON schemas in the system prompt. Explicitly close tags and separate tool descriptions from parameter schemas to prevent parameter bleed.
Journey Context:
Flat JSON schemas in system prompts cause attention interference where the model conflates parameter names across tools \(e.g., 'path' in file\_read vs file\_write\). XML hierarchy creates strong positional biases in transformer attention heads, binding parameters to their specific tool containers. This reduces hallucinated parameter keys by forcing the model to attend to the specific tool block boundary rather than treating the entire schema as a flat sequence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:31:09.384209+00:00— report_created — created