get-storage-document
Retrieve a storage document from a specific room in Liveblocks using the roomId. Access and manage shared data efficiently within collaborative environments.
Instructions
Get a Liveblocks storage document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes |
Implementation Reference
- src/server.ts:191-204 (registration)Registration of the 'get-storage-document' MCP tool, including input schema (roomId: string), description, and inline handler function that fetches the storage document from Liveblocks API using getLiveblocks() client and callLiveblocksApi utility.server.tool( "get-storage-document", "Get a Liveblocks storage document", { roomId: z.string(), }, async ({ roomId }, extra) => { return await callLiveblocksApi( getLiveblocks().getStorageDocument(roomId, "json", { signal: extra.signal, }) ); } );
- src/server.ts:197-203 (handler)The handler function for the 'get-storage-document' tool. It takes roomId, calls the Liveblocks client's getStorageDocument method with 'json' format, wraps it in callLiveblocksApi, and passes the extra.signal for abort control.async ({ roomId }, extra) => { return await callLiveblocksApi( getLiveblocks().getStorageDocument(roomId, "json", { signal: extra.signal, }) ); }
- src/server.ts:194-196 (schema)Input schema for 'get-storage-document' tool: requires a roomId string.{ roomId: z.string(), },
- src/server.ts:21-28 (helper)Helper function getLiveblocks() that lazily initializes and returns the Liveblocks client used in the tool handler.function getLiveblocks() { if (!client) { client = new Liveblocks({ secret: process.env.LIVEBLOCKS_SECRET_KEY as string, }); } return client; }