find_and_replace_code
Replace text patterns in files with regex support, controlling case sensitivity and replacing all occurrences.
Instructions
Find and replace text patterns in a file with regex support
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>",
"searchPattern": "<searchPattern>",
"replaceWith": "<replaceWith>"
},
"name": "find_and_replace_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the file to modify | |
| isRegex | No | Whether the search pattern is a regex | |
| replaceAll | No | Whether to replace all occurrences | |
| replaceWith | Yes | The replacement text | |
| caseSensitive | No | Whether the search should be case sensitive | |
| searchPattern | Yes | The pattern to search for (supports regex) |