write_comments
Write to review comment threads to add private replies, anchored suggestions, and public Overleaf drafts; edit or delete entries only when revision checks pass.
Instructions
Write to a comment thread. What you write is private, on the review page for the reviewer and you. overleaf drafts what becomes public, on Overleaf for everyone in the project, once the reviewer sends it. add: text and anchor, plus changes, quoted as for suggest, when the reviewer has asked for proposals left as comments; the new thread then carries that proposal. reply: id and text, or a saved draft on its own. suggest: id, text, changes, rev. Each change's old is quoted from the file the comment is on and must occur there exactly once, as an editing tool expects; never give a line or a column. It replaces the thread's single current proposal and adds text as a reply, so the conversation stays complete. It is refused on a thread the reviewer has not written in: propose on their thread instead of opening your own beside it. withdraw: id, text, rev. overleaf: id, text, rev, and edits naming the source ranges the reply describes, by their current lines; later edits move these ranges as they move a comment, so the draft does not need rewriting when lines shift. On a thread that came from Overleaf (on_overleaf), it drafts the public reply that the reviewer may send there. A thread has one draft, which this replaces, and only the reviewer sends it. A first message the reviewer wrote themselves (overleaf_draft_by: reviewer) is not replaced: your text is added to the thread as your private reply suggesting the wording. The reviewer is asked first when a file that contains those ranges differs between here and Overleaf. Since the draft is public once sent, word it for the people on Overleaf, and answer what the reviewer asks you in the thread with reply, which is private. With anchor (a source_range) instead of id and rev, overleaf drafts a new public thread for Overleaf on those lines, with text as its first message. The result is a thread that has the draft and is not on Overleaf. Call overleaf with its id and rev to redraft it. Only the reviewer sends it, and only once the current text of those ranges is on Overleaf. The reviewer may discuss the draft with you in the thread before sending it, and those entries are private. A thread the reviewer started for Overleaf (new_thread) is waiting for its first message there. What they wrote in it is private and meant for you, and overleaf with id and rev drafts the message they asked for, keeping the meaning of their words and using the register they asked for. edit: id, entry, text, rev; rewrites an entry you wrote. delete: id; refused once the reviewer has written in the thread. rev is the thread's token from read_comments; if the thread has changed since, the write is refused. edits names the source ranges a reply changed. A field the action does not take is refused. The reviewer resolves threads, not you. Returns id, status and rev.
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": {
"action": "<action>"
},
"name": "write_comments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| rev | No | ||
| text | No | ||
| draft | No | ||
| edits | No | ||
| entry | No | ||
| action | Yes | ||
| anchor | No | ||
| changes | No |