Search and Replace
search_and_replaceReplace substrings in files with fuzzy whitespace fallback, preview changes via dry-run, and validate syntax for .py, .json, .toml, .yaml. Returns unified diff.
Instructions
Primary file editing tool — prefer over patch. Replaces substrings with fuzzy whitespace fallback. Returns unified diff. Validates .py/.json/.toml/.yaml syntax.
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": {
"filepath": "<filepath>",
"edits": "<edits>"
},
"name": "search_and_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | [{"old": "exact_text", "new": "replacement"}] | |
| dry_run | No | Preview diff without applying. | |
| filepath | Yes | File path relative to /workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |