Comment Threads
Read and create comment threads on documents
Overview
Comment-thread tools read the discussion on a document and start new threads on it. A thread is either anchored to a passage of the document's text, or artifact-level, meaning it is about the document as a whole.
Both tools take the document as documentId, which accepts a UUID or a slug (PRD-*, PLN-*, ISS-*, DOC-*; legacy FEA-* slugs still resolve). Pass the user's slug verbatim.
| Tool | Scope |
|---|---|
get-document-comments | read |
create-document-thread | write |
A tool is offered to a session only when the session's credential carries its scope. When a call fails, the tool returns an isError result whose text gives the error title, a description, and, when the API sent them, the error code, message, and timestamp.
These tools cover document threads only. Comments on agent sessions are read with list-session-comments; see Agent Session Reporting.
Get Document Comments
Tool: get-document-comments
Scope: read
Underlying API: GET /documents/{documentId}/threads (with ?status=<value> when status is given)
| Name | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | Document UUID or slug (e.g. PRD-7, PLN-12, ISS-42). Blank values, ., and .. are rejected. |
status | "OPEN" | "RESOLVED" | No | Return only threads with this status. Omit to return all threads. |
Returns
A JSON array of threads, each with its comments:
[
{
"id": "c3d4e5f6-...",
"status": "OPEN",
"source": "LIVEBLOCKS",
"anchorStatus": "anchored",
"artifactId": "0b9a8c7d-...",
"createdAt": "2026-10-01T12:00:00.000Z",
"comments": [
{
"id": "d4e5f6a7-...",
"plainText": "Should this cover the mobile flow too?",
"createdAt": "2026-10-01T12:00:00.000Z",
"author": "a1b2c3d4-..."
}
]
}
]| Field | Meaning |
|---|---|
status | OPEN or RESOLVED. |
source | The system that holds the thread: NATIVE, LIVEBLOCKS, or GITHUB. |
anchorStatus | anchored (attached to text in the document), floating (its anchor text is no longer found in the document), artifact-level (about the whole document), or null when the thread carries no anchor information the server can read. |
comments[].author | The author's user UUID. Resolve it with list-users. |
The tool returns the whole list in one response; it has no pagination.
Errors
- The document does not exist in your organization:
Artifact not found(404).
Example
get-document-comments(documentId: "PRD-42", status: "OPEN")Create a Document Thread
Tool: create-document-thread
Scope: write
Underlying API: POST /documents/{documentId}/threads
Starts a new thread with one comment. With anchorText, the thread is anchored to that text in the document. Without it, the thread is artifact-level.
| Name | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | Document UUID or slug. |
body | string | Yes | Comment text. Minimum 1 character. |
anchorText | string | No | Exact text in the document to anchor the thread to. Minimum 1 character. Case-sensitive, and it must occur exactly once in the document. It may span inline formatting such as bold or italic within one block (a paragraph, heading, or list item), but it cannot cross from one block into another. Omit for an artifact-level thread. |
The whole request body may be at most 32,768 bytes.
Returns
The API response, as JSON:
{
"commentId": "d4e5f6a7-...",
"threadId": "c3d4e5f6-..."
}The response may also carry an operationReceipt object recording the write.
Errors
- The document does not exist in your organization:
Artifact not found(404). anchorTextis not found in the document:Anchor text not found in document(400).anchorTextoccurs more than once in the document: a 400 such asAnchor text "checkout" appears 3 times in the document; use more specific text.- An empty
bodyor emptyanchorText: a 400 validation error. A request body over 32,768 bytes:Request body too large(413). - Other failures, such as the comment store being unavailable, return a generic
Failed to create threaderror.
Example
create-document-thread(documentId: "PRD-42", body: "Should this cover the mobile flow too?", anchorText: "checkout flow")