Commit 2d3e7dd
committed
Improve tool descriptions to guide proper file editing tool selection
### Problem
LLMs were frequently choosing `write_to_file` for file edits instead of more appropriate tools like `apply_diff`, `insert_content`, or `search_and_replace`. This was likely because the tool descriptions made it seem like files needed to be reconstructed rather than edited.
### Changes Made
**write_to_file tool description:**
- Clarified primary use cases: **creating new files** or **complete rewrites when intentionally required**
- Changed opening from "write full content" to "write content" to reduce emphasis on full reconstruction
- Updated parameter description to be more specific about when complete content is needed
**apply_diff tool description:**
- Enhanced description to emphasize "targeted modifications" and "precise, surgical edits"
- Clarified that multiple search/replace operations can be performed in a single call
- Removed misleading "only a single operation allowed" restriction
- Better positioned as the preferred tool for making several targeted changes efficiently
### Impact
These changes should guide LLMs toward:
- Using `write_to_file` primarily for new files or intentional complete rewrites
- Using `apply_diff` for targeted edits and modifications to existing files
- Better understanding of when each tool is most appropriate
The updated descriptions maintain necessary technical details while providing clearer guidance on tool selection without being overly prescriptive.1 parent be9195c commit 2d3e7dd
File tree
3 files changed
+28
-44
lines changed- src/core
- diff/strategies
- prompts
- __tests__/__snapshots__
- tools
3 files changed
+28
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 94 | + | |
| 95 | + | |
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
| |||
0 commit comments