file_edit
Replace a specific substring in a file, with support for replacing all occurrences when needed.
Instructions
Replace a substring in an existing file. The substring must occur exactly once unless replaceAll is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative path of the file to edit | |
| oldString | Yes | Exact substring to replace (must occur exactly once unless replaceAll is true) | |
| newString | Yes | Replacement string | |
| replaceAll | No | Replace every occurrence (default: false) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| requiresHarnessSession | Yes | ||
| error | Yes | ||
| _hints | Yes |