edit_block
Replace exact text in a file when you need a precise, verifiable edit. Specify the target string, its replacement, and how many matches to expect.
Instructions
Replace exact text in a file. old_string must match exactly and occur expected_replacements times (default 1). Include enough context to make it unique.
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": {
"file_path": "<file_path>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_block"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| new_string | Yes | ||
| old_string | Yes | ||
| expected_replacements | No |