get-rooms
Retrieve recent Liveblocks rooms based on specific criteria such as limit, user ID, group IDs, room ID, or metadata. Streamline room management and data access.
Instructions
Get recent Liveblocks rooms
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupIds | No | ||
| limit | Yes | ||
| query | No | ||
| startingAfter | No | ||
| userId | No |
Implementation Reference
- src/server.ts:32-59 (registration)Registration of the 'get-rooms' MCP tool, including input schema definition and inline handler function that proxies to Liveblocks.getRooms API via callLiveblocksApi.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 } ) ); } );
- src/server.ts:35-50 (schema)Input schema for the 'get-rooms' tool using Zod validation.{ 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(), },
- src/server.ts:51-58 (handler)Handler function for 'get-rooms' tool: calls Liveblocks.getRooms with provided parameters and wraps in callLiveblocksApi.async ({ limit, userId, groupIds, startingAfter, query }, extra) => { return await callLiveblocksApi( getLiveblocks().getRooms( { limit, userId, groupIds, startingAfter, query }, { signal: extra.signal } ) ); }