write_file
Replaces document text with operational-transform edits that retain unchanged regions. Requires a recent document ID and version to reject stale writes and verify applied content.
Instructions
Replace text using OT edits that retain unchanged regions. Requires docId/version from a recent read. Rejects stale versions; waits for server application and verifies document identity and content. An unknown write outcome blocks further writes to that document on the connection; reconnect and inspect before retrying. Concurrent edits may be merged by 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": {
"projectId": "<projectId>",
"path": "<path>",
"expectedDocId": "<expectedDocId>",
"expectedVersion": "<expectedVersion>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| projectId | Yes | ||
| expectedDocId | Yes | ||
| expectedVersion | Yes |