replace_lines
Replaces a specified line range in a file with new text, supporting insertion before a line by setting end_line to start_line minus one.
Instructions
Replace lines start_line..end_line (1-based, inclusive) with new_text. Use end_line=start_line-1 to insert before start_line.
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>",
"start_line": "<start_line>",
"end_line": "<end_line>",
"new_text": "<new_text>"
},
"name": "replace_lines"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| dry_run | No | ||
| end_line | Yes | ||
| new_text | Yes | ||
| start_line | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |