Edit file
edit_fileApply git-style line edits to a file under the root. Each edit replaces lines [startLine, endLine] (1-indexed, inclusive) with newLines. To delete lines, pass an empty newLines array.
Instructions
Apply git-style line edits to a file under the root. Each edit replaces lines [startLine, endLine] (1-indexed, inclusive) with newLines. To delete lines, pass an empty newLines array. To insert without deleting anything, set endLine = startLine - 1. Multiple edits in one call are applied bottom-to-top so line numbers stay valid.
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>",
"edits": "<edits>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to root | |
| edits | Yes | ||
| createIfMissing | No |