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