replaceFileContent
Replace exact text within specified start and end lines of a file with new content, avoiding ambiguous matches.
Instructions
Surgically replace exact targetContent inside bounded lines [startLine, endLine].
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": {
"targetFile": "<targetFile>",
"targetContent": "<targetContent>",
"replacementContent": "<replacementContent>",
"startLine": "<startLine>",
"endLine": "<endLine>"
},
"name": "replaceFileContent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | End line of search window. | |
| startLine | Yes | Start line of search window. | |
| targetFile | Yes | Path to target file. | |
| instruction | No | What this edit does. | |
| allowMultiple | No | Allow replacing multiple matches. | |
| targetContent | Yes | Exact string to be replaced. | |
| replacementContent | Yes | New string to insert. |