edit_file
Apply targeted text replacements in an existing file, automatically creating a backup for safe recovery.
Instructions
Apply targeted text replacements in an existing file with backups.
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>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| old_text | No | ||
| new_text | No | ||
| replace_all | No | ||
| edits | No | ||
| ctx | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |