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
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes | ||
| options | No |
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 }) ); } );
- src/server.ts:211-220 (schema)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(), },
- src/server.ts:221-225 (handler)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 }) ); }