update_file
Replace a selected line range in an existing UTF-8 text file. Re-read the file between updates to avoid line-number shifts.
Instructions
Replace an inclusive 1-based line range in an existing UTF-8 text file. Line numbers shift after every edit, so read the file again between updates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path relative to the workspace root, or an allowed absolute path. | |
| content | Yes | Replacement content; an empty string deletes the selected lines. | |
| end_line | Yes | Last line to replace (inclusive). | |
| start_line | Yes | First line to replace (1-based). | |
| expected_sha256 | No | Optional SHA-256 returned by a previous read or write. The call fails if the file changed since then. |