Skip to main content
Glama
liveblocks
by liveblocks

get-yjs-document

Retrieve a Yjs text document from a specified Liveblocks room. Use the 'roomId' to identify the room and optional parameters like 'format' and 'key' for customization.

Instructions

Get a Liveblocks Yjs text document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optionsNo
roomIdYes

Implementation Reference

  • src/server.ts:208-226 (registration)
    Registration of the 'get-yjs-document' tool with inline Zod input schema and handler function. The handler fetches the Yjs document from Liveblocks API using getLiveblocks().getYjsDocument wrapped in callLiveblocksApi.
    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 }) ); } );
  • Handler function for 'get-yjs-document' tool that calls the Liveblocks library's getYjsDocument method.
    async ({ roomId, options }, extra) => { return await callLiveblocksApi( getLiveblocks().getYjsDocument(roomId, options, { signal: extra.signal }) ); }
  • Input schema for 'get-yjs-document' tool using Zod, defining roomId (required string) and optional options object.
    { roomId: z.string(), options: z .object({ format: z.boolean().optional(), key: z.string().optional(), type: z.string().optional(), }) .optional(), },

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