Source Refactor
source_refactorApply multiple exact find-and-replace edits to a source file atomically, validating each match before writing so failed edits leave the file unchanged.
Instructions
Apply a batch of exact string replacements atomically: every find string is validated for existence and uniqueness before any write happens. Nothing is written when any operation fails validation.
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": {
"relativePath": "<relativePath>",
"operations": "<operations>"
},
"name": "source_refactor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | Ordered list of exact find/replace operations. | |
| relativePath | Yes | File to refactor, relative to the workspace root. |