overleaf_replace_text
Replace an exact snippet in an Overleaf project file to make targeted edits, optionally replacing every occurrence or submitting as a tracked change.
Instructions
Replace an exact snippet of a document — the preferred way to make targeted edits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "overleaf_replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path in the project, e.g. 'main.tex' or 'chapters/intro.tex'. | |
| project | Yes | Project id, Overleaf project URL, or exact project name. | |
| new_text | Yes | Replacement text (may be empty to delete). | |
| old_text | Yes | Exact text to replace; must be unique unless replace_all. | |
| replace_all | No | Replace every occurrence. | |
| track_changes | No | Submit as a tracked change (suggestion) instead of a direct edit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |