edit-comment
Modify existing comments in Liveblocks collaborative spaces by updating text, formatting, or mentions to correct errors or improve clarity.
Instructions
Edit a Liveblocks comment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roomId | Yes | ||
| threadId | Yes | ||
| commentId | Yes | ||
| data | Yes |
Implementation Reference
- src/server.ts:492-513 (registration)Full registration of the 'edit-comment' tool using McpServer.tool(), including input schema and inline handler function that proxies to Liveblocks.editComment API.server.tool( "edit-comment", `Edit a Liveblocks comment`, { roomId: z.string(), threadId: z.string(), commentId: z.string(), data: z.object({ body: CommentBody, userId: z.string(), editedAt: z.date().optional(), }), }, async ({ roomId, threadId, commentId, data }, extra) => { return await callLiveblocksApi( getLiveblocks().editComment( { roomId, threadId, commentId, data }, { signal: extra.signal } ) ); } );
- src/zod.ts:3-36 (schema)Zod schema definition for CommentBody, used in the input schema of 'edit-comment' tool for the data.body parameter.const CommentBodyText = z.object({ text: z.string(), bold: z.boolean().optional(), italic: z.boolean().optional(), strikethrough: z.boolean().optional(), code: z.boolean().optional(), }); const CommentBodyMention = z.object({ type: z.literal("mention"), id: z.string(), }); const CommentBodyLink = z.object({ type: z.literal("link"), url: z.string(), text: z.string().optional(), }); const CommentBodyInlineElement = z.union([ CommentBodyText, CommentBodyMention, CommentBodyLink, ]); const CommentBodyParagraph = z.object({ type: z.literal("paragraph"), children: z.array(CommentBodyInlineElement), }); export const CommentBody = z.object({ version: z.literal(1), content: z.array(CommentBodyParagraph), });