edit_file
Replace an exact substring in an Overleaf project file and upload the result, allowing precise text updates without rewriting the whole file. Supports replacing all occurrences or forcing overwrite when needed.
Instructions
Replace an exact substring in a project file and upload the result.
Fails if old is missing, or if it appears more than once and replace_all is false. Prefer this over write_file for a paragraph or sentence change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | Replacement text | |
| old | Yes | Exact text to find (must match once unless replace_all) | |
| path | Yes | Path inside the project, e.g. main.tex | |
| force | No | Overwrite even if the file changed since the last read | |
| project | Yes | Project id (24-char hex) or exact name | |
| replace_all | No | Replace every occurrence if old appears more than once |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||