Report #26387
[agent\_craft] Agent selects wrong tool or hallucinates parameters because tool descriptions are too generic or copy-pasted from OpenAPI specs without context
Augment tool descriptions with 'Usage Examples' in the description field: provide 2-3 real parameter values from the current project context. Format: 'Tool: create\_file. Example: create\_file\(path="src/utils/helpers.py", content="def foo\(\): pass"\)'. Update these examples dynamically if the tool is used frequently with different patterns.
Journey Context:
Standard tool schemas \(JSON Schema\) are descriptive but not prescriptive; they lack the 'tacit knowledge' of how tools are composed in this specific codebase \(e.g., 'we always pass absolute paths to read\_file'\). Generic descriptions lead to 'affordance confusion'—the model picks the wrong tool because descriptions overlap \(e.g., 'edit\_file' vs 'replace\_string'\). Dynamic few-shot examples within the tool description act as grounding anchors, similar to 'retrieval-augmented generation' but for tool selection. This is distinct from general few-shot prompting; the examples are embedded in the tool schema itself.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:41:25.954228+00:00— report_created — created