replace_lines_code
Replace a range of lines in a file with new content, verifying the original code matches exactly before applying changes.
Instructions
Replace specific lines in existing files with exact content 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": {
"path": "<path>",
"startLine": "<startLine>",
"endLine": "<endLine>",
"content": "<content>",
"originalCode": "<originalCode>"
},
"name": "replace_lines_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the file to modify | |
| content | Yes | The new content to replace the lines with | |
| endLine | Yes | The end line number (1-based, inclusive) | |
| startLine | Yes | The start line number (1-based, inclusive) | |
| originalCode | Yes | The original code for validation - must match exactly |