edit_file
Replace an exact string in a file within a granted root, saving the updated file to disk.
Instructions
Edit a file inside a granted root by replacing an exact string with a new string, then saving it to disk.
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_str": "<old_str>",
"new_str": "<new_str>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file to edit, inside a granted root. | |
| new_str | Yes | The new text to insert in place of old_str. | |
| old_str | Yes | The exact text to find and replace. Must match exactly, including whitespace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |