Edit File
editApply targeted exact text replacement in workspace files and receive a unified diff to review changes.
Instructions
Apply a targeted exact text replacement inside a workspace text file. Returns a unified diff.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to workspace root. | |
| new_text | Yes | Replacement text. | |
| old_text | Yes | Exact text to replace. Must match once unless replace_all=true. | |
| replace_all | No | Replace all occurrences. Default: false. | |
| workspace_id | No | Workspace id from open_workspace. Omit to use default workspace. | |
| expected_replacements | No | Fail if actual replacement count differs. |