Edit part of a file
edit_blockReplace exact text inside an existing text file. Safer than rewriting the whole file: it fails, and changes nothing, if old_string is not found or appears a different number of times than expected_replacements (default 1).
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_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_block"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| device | No | Device name. Optional when the account has only one online device. | |
| new_string | Yes | Text to put in its place. | |
| old_string | Yes | Exact text to find (including whitespace). Must not be empty. | |
| expected_replacements | No | How many times old_string should appear. Default 1. |