Edit File
edit_fileReplace exact text blocks in a file and return a unified diff, avoiding full-file rewrites. Use for precise, low-cost edits with optional dry-run preview.
Instructions
Surgical edit: replace exact text blocks and return a unified diff. Much cheaper than rewriting a whole file.
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": {
"path": "<path>",
"edits": "<edits>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File to edit. | |
| edits | Yes | One or more find/replace edits, applied in order. | |
| dry_run | No | Only show the diff, don't save. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||