Report #41539
[tooling] Agent ignores critical constraints buried at the end of long tool descriptions
Front-load mandatory constraints and warnings in the first 120 characters using bold markdown; keep total description under 300 tokens.
Journey Context:
LLMs \(Claude, GPT-4\) often see only the first ~200 tokens of a tool description when deciding whether to invoke it; details at the end are effectively invisible or heavily deprioritized. Developers commonly write narrative descriptions like 'This tool searches the database... \[200 words\]... IMPORTANT: You must provide start\_date', placing critical constraints at the bottom. The agent then omits required parameters. The fix is to write descriptions like '\*\*REQUIRED:\*\* Always provide \`start\_date\`. Searches database...', ensuring the mandatory instruction is in the high-attention region. Additionally, avoid JSON pretty-printing in examples within the description to save token space. This is derived from empirical testing with Claude's tool use, not just general prompt engineering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:11:44.311376+00:00— report_created — created