Report #55891
[agent\_craft] Model over-uses or ignores specific tools \(e.g., using 'read\_file' instead of 'grep'\) due to position bias in tool list
Order tools from most-specific to least-specific in the tools array, and dynamically prune the tool list to only include relevant tools for the current task context \(e.g., hide 'docker' tools when editing CSS\).
Journey Context:
LLMs exhibit a 'recency' and 'primacy' bias in tool selection. If you list a general 'read\_file' tool before a specific 'grep' tool, the model will often read the entire file instead of grepping for the specific line, wasting tokens and time. We tried randomizing tool order, but that made behavior non-deterministic. The robust solution is two-fold: \(1\) Static ordering: place the most specific/powerful tools \(e.g., 'edit\_file'\) at the top, and general utility tools \(e.g., 'ask\_user'\) at the bottom. \(2\) Dynamic context: maintain a 'tool registry' that filters the available tools based on the current directory or task \(e.g., only show 'pytest' tools when in a Python project\). This reduces the 'tool noise' significantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:18:27.754530+00:00— report_created — created