get-comment
Retrieve specific comments from Liveblocks collaborative rooms using room, thread, and comment identifiers for real-time collaboration management.
Instructions
Get a Liveblocks comment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes | ||
| threadId | Yes | ||
| commentId | Yes |
Implementation Reference
- src/server.ts:474-490 (registration)Registration of the 'get-comment' MCP tool, including schema and handler function.server.tool( "get-comment", `Get a Liveblocks comment`, { roomId: z.string(), threadId: z.string(), commentId: z.string(), }, async ({ roomId, threadId, commentId }, extra) => { return await callLiveblocksApi( getLiveblocks().getComment( { roomId, threadId, commentId }, { signal: extra.signal } ) ); } );
- src/server.ts:482-489 (handler)Handler function that fetches the specified comment from Liveblocks API using getLiveblocks().getComment and formats the response.async ({ roomId, threadId, commentId }, extra) => { return await callLiveblocksApi( getLiveblocks().getComment( { roomId, threadId, commentId }, { signal: extra.signal } ) ); }
- src/server.ts:477-481 (schema)Zod input schema defining parameters: roomId, threadId, and commentId as strings.{ roomId: z.string(), threadId: z.string(), commentId: z.string(), },
- src/utils.ts:3-37 (helper)Helper function callLiveblocksApi used by the handler to wrap Liveblocks API calls and format MCP responses.export async function callLiveblocksApi( liveblocksPromise: Promise<any> ): Promise<CallToolResult> { try { const data = await liveblocksPromise; if (!data) { return { content: [{ type: "text", text: "Success. No data returned." }], }; } return { content: [ { type: "text", text: "Here is the data. If the user has no specific questions, return it in a JSON code block", }, { type: "text", text: JSON.stringify(data, null, 2), }, ], }; } catch (err) { return { content: [ { type: "text", text: "" + err, }, ], }; } }