You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
The multi_replace_string_tool currently fails when attempting to replace a string that appears multiple times in a file, throwing the error:
String replacement failed: Multiple matches found for the text to replace. Multiple exact matches found. Make your search string more specific.
Expected Behavior
When multiple occurrences are detected, the tool should provide clearer guidance and support the ability to replace all occurrences.
Proposed Solution
Add an optional replaceAll parameter to multi_replace_string_in_file tool
Improve error message: When multiple matches are found and replaceAll is not set, the error message should:
Suggest using replaceAll: true to replace all occurrences
Include line numbers where duplicates were found so the model can verify the edit is valid
Benefits
Reduces friction when making repetitive changes across a file
Provides actionable guidance instead of just failing