get-active-users
Retrieve real-time active user data from Liveblocks collaboration rooms to monitor engagement and manage room capacity.
Instructions
Get a Liveblocks room's active users
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes |
Implementation Reference
- src/server.ts:162-173 (registration)Registration of the 'get-active-users' MCP tool, including input schema (roomId: string) and inline handler function that calls the Liveblocks API via getLiveblocks().getActiveUsers and formats response with callLiveblocksApi.server.tool( "get-active-users", "Get a Liveblocks room's active users", { roomId: z.string(), }, async ({ roomId }, extra) => { return await callLiveblocksApi( getLiveblocks().getActiveUsers(roomId, { signal: extra.signal }) ); } );
- src/server.ts:168-172 (handler)The handler function executing the tool logic: fetches active users for the given roomId using Liveblocks client, wrapped in callLiveblocksApi for MCP response formatting.async ({ roomId }, extra) => { return await callLiveblocksApi( getLiveblocks().getActiveUsers(roomId, { signal: extra.signal }) ); }
- src/server.ts:165-167 (schema)Input schema for the tool: requires a roomId string.{ roomId: z.string(), },