create-thread
Create collaborative comment threads in real-time rooms for team discussions and feedback.
Instructions
Create a Liveblocks thread. Always ask for a userId.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes | ||
| data | Yes |
Implementation Reference
- src/server.ts:275-279 (handler)The handler function that executes the 'create-thread' tool logic by proxying to the Liveblocks createThread API wrapped in callLiveblocksApi.async ({ roomId, data }, extra) => { return await callLiveblocksApi( getLiveblocks().createThread({ roomId, data }, { signal: extra.signal }) ); }
- src/server.ts:262-274 (schema)Input schema for the 'create-thread' tool, defining parameters roomId and data (with comment body, userId, and optional metadata). Uses CommentBody from zod.ts.{ roomId: z.string(), data: z.object({ comment: z.object({ body: CommentBody, userId: z.string(), createdAt: z.date().optional(), }), metadata: z .record(z.string(), z.union([z.string(), z.boolean(), z.number()])) .optional(), }), },
- src/server.ts:259-280 (registration)Registration of the 'create-thread' tool on the MCP server, including name, description, input schema, and inline handler function.server.tool( "create-thread", `Create a Liveblocks thread. Always ask for a userId.`, { roomId: z.string(), data: z.object({ comment: z.object({ body: CommentBody, userId: z.string(), createdAt: z.date().optional(), }), metadata: z .record(z.string(), z.union([z.string(), z.boolean(), z.number()])) .optional(), }), }, async ({ roomId, data }, extra) => { return await callLiveblocksApi( getLiveblocks().createThread({ roomId, data }, { signal: extra.signal }) ); } );