Edit local file
editReplace one exact text string in an existing local text file only when it occurs exactly once; if it is missing or duplicated, the operation fails.
Instructions
Make one exact targeted replacement in an existing local text file. old_text must occur exactly once; the call fails if it occurs zero times or more than once.
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_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the existing text file. | |
| new_text | Yes | Replacement text. May be empty to delete old_text. | |
| old_text | Yes | Exact text that must occur exactly once. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| bytes_after | Yes | ||
| bytes_before | Yes | ||
| replacements | Yes |