get-rooms
Retrieve recent Liveblocks rooms with filtering options for user, groups, or metadata to manage collaborative workspaces.
Instructions
Get recent Liveblocks rooms
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | ||
| userId | No | ||
| groupIds | No | ||
| startingAfter | No | ||
| query | No |
Implementation Reference
- src/server.ts:32-59 (registration)Full registration of the MCP 'get-rooms' tool, including name, description, Zod input schema, and inline asynchronous handler function that executes the tool logic by calling the Liveblocks SDK's getRooms method, wrapped with callLiveblocksApi for response formatting.
server.tool( "get-rooms", `Get recent Liveblocks rooms`, { limit: z.number().lte(100), userId: z.string().optional(), groupIds: z.array(z.string()).optional(), startingAfter: z.string().optional(), query: z .object({ roomId: z .object({ startsWith: z.string(), }) .optional(), metadata: z.record(z.string(), z.string()).optional(), }) .optional(), }, async ({ limit, userId, groupIds, startingAfter, query }, extra) => { return await callLiveblocksApi( getLiveblocks().getRooms( { limit, userId, groupIds, startingAfter, query }, { signal: extra.signal } ) ); } );