Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

get-yjs-document

Retrieve a Yjs text document from a Liveblocks collaborative room to access and work with shared real-time content.

Instructions

Get a Liveblocks Yjs text document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
optionsNo

Implementation Reference

  • src/server.ts:208-226 (registration)
    Registration of the MCP tool 'get-yjs-document' using McpServer.tool()
    server.tool(
      "get-yjs-document",
      "Get a Liveblocks Yjs text document",
      {
        roomId: z.string(),
        options: z
          .object({
            format: z.boolean().optional(),
            key: z.string().optional(),
            type: z.string().optional(),
          })
          .optional(),
      },
      async ({ roomId, options }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().getYjsDocument(roomId, options, { signal: extra.signal })
        );
      }
    );
  • Zod input schema for the 'get-yjs-document' tool: requires roomId, optional options object with format, key, type.
    {
      roomId: z.string(),
      options: z
        .object({
          format: z.boolean().optional(),
          key: z.string().optional(),
          type: z.string().optional(),
        })
        .optional(),
    },
  • Handler function that delegates to Liveblocks client's getYjsDocument method via callLiveblocksApi wrapper.
    async ({ roomId, options }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().getYjsDocument(roomId, options, { signal: extra.signal })
      );
    }

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