Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

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
NameRequiredDescriptionDefault
roomIdYes
threadIdYes
commentIdYes
dataYes

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 }
          )
        );
      }
    );
  • 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),
    });

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