Batch Replace
batch_replaceSearch and replace exact text across multiple files matched by a glob pattern, with a configurable safety cap on modified files.
Instructions
Search and replace a string across multiple files matching a glob pattern.
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": {
"pattern": "<pattern>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "batch_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Glob pattern matching files (e.g. 'src/**/*.py', '*.ts'). | |
| max_files | No | Safety cap on modified files. | |
| root_path | No | Base directory for search. | . |
| new_string | Yes | Replacement text. | |
| old_string | Yes | Exact text to search for. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |