edit_file
Replace a unique file snippet safely—preview the diff without confirm, then confirm to apply; it backs up first.
Instructions
Replace one unique snippet of a file. Without confirm=true it only returns the diff. Backs up first.
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>",
"old": "<old>",
"new": "<new>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | ||
| old | Yes | ||
| path | Yes | ||
| confirm | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |