Report #31106
[agent\_craft] Tool schema placement in system prompt causes hallucinated function calls
Place function definitions immediately after identity section and before instructional text, not at the end of the system prompt.
Journey Context:
Placing schemas at the end causes the model to treat them as an afterthought, leading to hallucinated arguments or wrong tool selection because the instruction text overwrites the schema 'type constraints' in the attention window. Placing them early primes the model's parser before it reads behavioral instructions. This follows the 'Lost in the Middle' recency effects but exploits primacy for schema binding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:36:02.533041+00:00— report_created — created