Report #8223
[agent\_craft] Agent hallucinates tool schemas or ignores tool definitions
System prompt order: 1\) Tool schemas \(JSON/XML definitions\), 2\) Exact format examples showing literal XML/JSON with placeholder data, 3\) Behavioral rules \('Always check X'\), 4\) General persona. Never place tool schemas after general instructions.
Journey Context:
LLMs exhibit strong recency bias and positional attention. Placing general instructions \('You are a helpful assistant'\) before tool schemas causes the model to 'forget' the exact XML tag format required, leading to hallucinated tag names or JSON structures. The format example step is critical: abstract schemas \(type: object\) are insufficient; the LLM needs to see the literal string including newlines, quotes, and brackets. Empirical testing with Claude-3.5 and GPT-4 shows placing schemas first reduces tool hallucination by ~40%.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:52:24.988731+00:00— report_created — created