edit_content
Edit large files by searching and replacing text with fuzzy matching, preview changes before applying, and automatically create backups for safe undo.
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.
Preview mode (default) shows diff without applying. Creates automatic
backup before changes - use revert_edit to undo. 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 |
|---|---|---|---|
| absolute_file_path | Yes | Absolute path to target file | |
| changes | Yes | Array of {search, replace, fuzzy?} objects. Applied in order. | |
| fuzzy | No | Enable fuzzy matching for all changes (default: true) | |
| preview | No | Show diff preview without applying changes. Always preview first! |