overleaf_edit_file
Edit documents in Overleaf projects by replacing specific text sections or the entire file content using Operational Transformation.
Instructions
Edits a file in an Overleaf project using Operational Transformation. You can either replace a specific chunk of text, or replace the entire file content.
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": {
"projectId": "<projectId>",
"filePath": "<filePath>",
"replacementContent": "<replacementContent>"
},
"name": "overleaf_edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The path of the document to edit (e.g., main.tex). | |
| projectId | Yes | The ID of the Overleaf project. | |
| targetContent | No | The exact existing text you want to replace. If omitted, the entire file will be replaced by replacementContent. | |
| replacementContent | Yes | The new text to insert. |