Skip to content

Guide: work through comments

When teammates leave comments on a page, an agent can work through them with you: fix what’s clearly right, answer questions, and leave the rest for you. This guide shows one prompt and every tool call an agent made for it, with Lyra’s real answers.

The page is How a change gets to production. Alex left three comments on it.

Go through the open comments on https://app.lyra-docs.com/p/01a2380b-adac-7754-8269-801be96f84aa. Fix the page where a comment is clearly right, reply to say what you changed, and resolve those threads. Leave anything else open for me.

Step Tool Why
1 list_comments Read the open threads and the text each one is about
2 search_page Find the block that holds a comment’s text
3 edit_blocks Fix that block, and add a section another comment asks for
4 reply Say what changed
5 resolve Close the threads it handled

The page’s id is the last part of its link:

list_comments
{ "pageId": "01a2380b-adac-7754-8269-801be96f84aa" }
{
"threads": [
{
"id": "01a23817-cf70-76d7-ba05-93ff0f9b745d",
"quotedText": "Rollback. Revert the merge commit.",
"resolved": false,
"createdAt": "2026-12-02T18:50:14.256Z",
"comments": [
{
"id": "01a23817-cf70-76d7-ba05-8f6cf7ac50f8",
"author": { "id": "01a23817-6725-731e-939e-4dae5b0bd73a", "name": "Alex" },
"markdown": "Nice, this is clear.",
"createdAt": "2026-12-02T18:50:14.256Z"
}
]
},
{
"id": "01a23817-cf48-7537-bb6c-6cab51e0c853",
"quotedText": null,
"resolved": false,
"createdAt": "2026-12-02T18:50:14.216Z",
"comments": [
{
"id": "01a23817-cf48-7537-bb6c-6b00a8170a8f",
"author": { "id": "01a23817-6725-731e-939e-4dae5b0bd73a", "name": "Alex" },
"markdown": "Can we say what happens when a deploy fails? People ask this a lot.",
"createdAt": "2026-12-02T18:50:14.216Z"
}
]
},
{
"id": "01a23817-cf14-75fe-84f0-153c4e0ceb9e",
"quotedText": "within 10 minutes",
"resolved": false,
"createdAt": "2026-12-02T18:50:14.164Z",
"comments": [
{
"id": "01a23817-cf14-75fe-84f0-107f4305fcc4",
"author": { "id": "01a23817-6725-731e-939e-4dae5b0bd73a", "name": "Alex" },
"markdown": "The number below says 9 minutes. Which one is right?",
"createdAt": "2026-12-02T18:50:14.164Z"
}
]
}
]
}
  • quotedText is the text the thread is attached to, or null for a comment on the whole page.
  • Resolved threads are left out. Add "includeResolved": true to see them too.

The third thread is about the words “within 10 minutes”. The agent finds the block that holds them, without reading the whole page:

search_page
{ "pageId": "01a2380b-adac-7754-8269-801be96f84aa", "query": "within 10 minutes" }
{
"pageId": "01a2380b-adac-7754-8269-801be96f84aa",
"total": 1,
"matches": [
{
"blockId": "0c0f3fe9-b3c6-4511-b8d7-733a48687a2c",
"markdown": "<!-- block:0c0f3fe9-b3c6-4511-b8d7-733a48687a2c -->\n**Deploy.** Merging to main ships it within 10 minutes.\n"
}
]
}

One call makes both changes: it replaces the block’s text by its id, and adds a section at the end of the page for the second thread.

edit_blocks
{
"pageId": "01a2380b-adac-7754-8269-801be96f84aa",
"edits": [
{
"op": "replace",
"blockId": "0c0f3fe9-b3c6-4511-b8d7-733a48687a2c",
"markdown": "**Deploy.** Merging to main ships it in about 9 minutes."
},
{
"op": "insert",
"markdown": "## When a deploy fails\n\nThe deploy stops, production keeps running the last version, and the person who merged gets a message in #deploys."
}
]
}
{
"ok": true,
"edits": [
{ "op": "replace", "blockIds": ["0c0f3fe9-b3c6-4511-b8d7-733a48687a2c"], "built": {}, "warnings": [] },
{
"op": "insert",
"blockIds": ["74982a8d-dc04-4db3-abd1-659ddc78a7ce", "5c60ae3b-ac57-4e17-be29-c0c8ee75ef1d"],
"built": {},
"warnings": []
}
]
}

replace keeps the block’s id and changes only the words that differ, so comments on the rest of the block stay where they are. An insert with no afterBlockId or beforeBlockId goes at the end of the page.

reply
{
"pageId": "01a2380b-adac-7754-8269-801be96f84aa",
"threadId": "01a23817-cf14-75fe-84f0-153c4e0ceb9e",
"markdown": "9 is right. I changed the card to say about 9 minutes."
}
{ "commentId": "01a23818-df7c-7760-9f23-1bd982e1b95d" }

And the same for the second thread, with “Added a When a deploy fails section at the end.”

resolve
{ "pageId": "01a2380b-adac-7754-8269-801be96f84aa", "threadId": "01a23817-cf14-75fe-84f0-153c4e0ceb9e" }
{ "ok": true }

The first thread, “Nice, this is clear.”, needs nothing from the page, so the agent leaves it open for you, as the prompt says. Listing the comments again shows only that one open thread. With "includeResolved": true, the other two come back with "resolved": true, and each has the agent’s reply as its second comment. The replies are under your name, Sam, since the agent works as you.

  • Say which comments the agent may close. “Resolve threads you fixed, and leave questions for me” keeps you in the loop.
  • Ask for a summary at the end, such as “list the threads you left open and why”.
  • To comment on a page instead, ask the agent to review it: it reads the page and starts threads with add_comment. With blockId and quote, a comment is attached to exact words in a block, the way a person highlights text.
  • Agents can delete comments and threads with delete_comment and delete_thread, which can’t be undone. Most apps ask you before they call these.