edit_file
Replace exact text in an attached project file and push the update to Overleaf by providing the file path, old text, and replacement text.
Instructions
Replace exact text in a file of the attached project and push it to Overleaf.
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": {
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File to edit, relative to the project root. | |
| message | No | Commit message shown in Overleaf's history. | |
| new_text | Yes | Replacement text. | |
| old_text | Yes | Exact text currently in the file, including whitespace and line breaks. Must be unique unless replace_all is true. | |
| replace_all | No | Replace every occurrence instead of requiring exactly one. |