Skip to main content
Glama
liveblocks
by liveblocks

get-thread-participants

Retrieve a list of participants from a specific thread in a Liveblocks room using room and thread IDs. Streamline collaboration and communication tracking.

Instructions

Get a Liveblocks thread's participants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
threadIdYes

Implementation Reference

  • The handler function that implements the core logic of the 'get-thread-participants' tool by invoking the Liveblocks SDK's getThreadParticipants method wrapped in utility functions.
    async ({ roomId, threadId }, extra) => { return await callLiveblocksApi( getLiveblocks().getThreadParticipants( { roomId, threadId }, { signal: extra.signal } ) ); }
  • Zod schema defining the input parameters for the tool: roomId and threadId as required strings.
    { roomId: z.string(), threadId: z.string(), },
  • src/server.ts:296-311 (registration)
    Registration of the 'get-thread-participants' tool on the McpServer instance, including description, schema, and handler.
    server.tool( "get-thread-participants", "Get a Liveblocks thread's participants", { roomId: z.string(), threadId: z.string(), }, async ({ roomId, threadId }, extra) => { return await callLiveblocksApi( getLiveblocks().getThreadParticipants( { roomId, threadId }, { signal: extra.signal } ) ); } );
  • Helper function to lazily initialize and provide 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; }
  • Utility function that wraps Liveblocks API calls, formats successful responses as JSON in MCP format, and handles errors.
    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, }, ], }; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/liveblocks/liveblocks-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server