edit_content
Modify large files using literal search/replace and fuzzy matching to avoid line-number errors; preview changes or apply them with automatic backups.
Instructions
Edit large files using search/replace with fuzzy matching.
Use instead of line-based editing to avoid LLM line number errors. Fuzzy
matching handles whitespace and formatting differences automatically.
Applies edits immediately by default and creates an automatic backup
(backup_created in the response) - use revert_edit to undo. The preview
field of the response holds the unified diff for post-hoc verification;
pass preview=true to dry-run first. Does NOT support regex in replacement
- patterns must be literal text (use fuzzy=true for flexibility).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"absolute_file_path": "<absolute_file_path>",
"changes": "<changes>"
},
"name": "edit_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fuzzy | No | Enable fuzzy matching for all changes (default: true) | |
| changes | Yes | Array of {search, replace, fuzzy?} objects. Applied in order. | |
| preview | No | Dry-run when true: shows the diff without writing. Default false: applies edits immediately, creates an automatic backup (returned as backup_created), and returns the unified diff in the preview field for post-hoc verification. | |
| absolute_file_path | Yes | Absolute path to target file |