replaceBlock
Replace exact text blocks in workspace files using content matching. Provides clear error messages when text not found or match is ambiguous.
Instructions
Replace exact text block in a workspace file by content match, no line numbers. Fails clearly if not found or ambiguous.
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>",
"oldContent": "<oldContent>",
"newContent": "<newContent>"
},
"name": "replaceBlock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | Save after replacing (default: true) | |
| filePath | Yes | Workspace or absolute file path | |
| newContent | Yes | The text to replace oldContent with | |
| oldContent | Yes | The exact text to find and replace (must match precisely, including whitespace) |