Patch files
patchApply multiple exact-string edits across one or more files in a single validated operation; if any edit fails, no file is changed. Use it to commit related changes together.
Instructions
Apply several exact-string edits across one or more files in a single all-or-nothing operation. Every edit is validated against the current file contents first; if any edit fails, NO file is modified and the failing edit index is reported. Use this instead of several edit_file calls when changes belong together. Read the affected files first with read_file. Changes are written to disk immediately when all edits are valid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | Edits to apply. All must be valid against the current file contents, otherwise nothing is written. | |
| workspace | No | Workspace name (see workspace_list). Defaults to the primary workspace. |