mark-thread-as-unresolved
Reopen a previously resolved Liveblocks thread to continue collaborative discussions or address ongoing issues in real-time collaboration spaces.
Instructions
Mark a Liveblocks thread as unresolved
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes | ||
| threadId | Yes | ||
| data | Yes |
Implementation Reference
- src/server.ts:358-376 (registration)MCP tool registration for 'mark-thread-as-unresolved', including the input schema (roomId, threadId, userId) and the inline handler function that calls the Liveblocks client's markThreadAsUnresolved method wrapped in callLiveblocksApi.server.tool( "mark-thread-as-unresolved", "Mark a Liveblocks thread as unresolved", { roomId: z.string(), threadId: z.string(), data: z.object({ userId: z.string(), }), }, async ({ roomId, threadId, data }, extra) => { return await callLiveblocksApi( getLiveblocks().markThreadAsUnresolved( { roomId, threadId, data }, { signal: extra.signal } ) ); } );
- src/utils.ts:3-37 (helper)Supporting utility function used by the tool handler (and others) to execute Liveblocks API promises and format the response (JSON data or error) as MCP CallToolResult content.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, }, ], }; } }
- src/server.ts:21-28 (schema)Local helper function that lazily initializes and returns the Liveblocks client instance used in the tool handler.function getLiveblocks() { if (!client) { client = new Liveblocks({ secret: process.env.LIVEBLOCKS_SECRET_KEY as string, }); } return client; }
- src/server.ts:368-375 (handler)The core handler function implementing the tool logic by proxying to the Liveblocks API.async ({ roomId, threadId, data }, extra) => { return await callLiveblocksApi( getLiveblocks().markThreadAsUnresolved( { roomId, threadId, data }, { signal: extra.signal } ) ); }