Skip to main content
Glama
liveblocks
by liveblocks

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
NameRequiredDescriptionDefault
roomIdYes

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, }) ); } );
  • 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, }) ); }
  • Input schema for 'get-storage-document' tool: requires a roomId string.
    { roomId: z.string(), },
  • 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; }

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