add_comment
Add and verify an anchored review comment in an Overleaf project file using UTF-16 positions and expected text; returns the created thread and document revision when readable.
Instructions
Add and verify an anchored review comment using UTF-16 positions and expectedText. Returns threadId, the created thread (id, status, messages with author { id, displayName }, content, and ISO timestamp) when it could be read back, the resulting document revision and protocol, trackChangesActive, writeMode, and recoveredAfterTimeout when an attachment that timed out, lost its socket, or could not be read back was confirmed by observation.
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>",
"revision": "<revision>",
"start": "<start>",
"end": "<end>",
"expectedText": "<expectedText>",
"content": "<content>"
},
"name": "add_comment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | ||
| start | Yes | ||
| content | Yes | ||
| filePath | Yes | Project-relative path using forward slashes | |
| revision | Yes | Opaque revision returned by a prior read or write | |
| projectId | Yes | Overleaf project ID | |
| expectedText | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread | No | ||
| protocol | Yes | ||
| revision | Yes | ||
| threadId | Yes | ||
| writeMode | Yes | ||
| trackChangesActive | Yes | ||
| recoveredAfterTimeout | No |