Report #8027
[agent\_craft] Agent confuses tool parameters with conversation content or hallucinates tool calls
Use XML/JSON delimiters to separate tool definitions, user context, and instruction blocks explicitly; place tool schemas in a dedicated 'tools' section, not inline with persona.
Journey Context:
Many agent implementations mix the system persona \('You are a helpful assistant'\), tool descriptions, and business logic in one paragraph. This causes the model to confuse which text is a tool parameter vs. conversation, especially with complex nested arguments. The hard-won pattern is strict structural separation: use XML tags like , , , . This mirrors Anthropic's Claude XML guidance and OpenAI's structured system messages. The tradeoff is verbosity \(XML tags consume tokens\), but the reduction in malformed JSON/misattributed parameters is worth it. Alternatives like 'just use newlines' fail at scale when tool schemas are large.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:20:33.948453+00:00— report_created — created