Patch File by Exact Line Range
fs_patch_linesReplace or delete exact 1-based line ranges in a file; pass an empty string to remove the selected lines. Use with line-reading or outline tools for precise code edits.
Instructions
按精确 1-based 起止行号替换或删除代码行(可配合 fs_read_lines / fs_outline 使用)。
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>",
"newContent": "<newContent>"
},
"name": "fs_patch_lines"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 目标文件路径 | |
| endLine | Yes | 结束行号(1-based,含) | |
| startLine | Yes | 起始行号(1-based,含) | |
| newContent | Yes | 替换后的新文本(传空字符串则删除该区间行) |