Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

edit-thread-metadata

Modify or remove metadata for threads in Liveblocks collaborative applications to organize and manage conversation data.

Instructions

Edit a Liveblocks thread's metadata. null can be used to remove a key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
threadIdYes
dataYes

Implementation Reference

  • src/server.ts:313-336 (registration)
    Registration of the 'edit-thread-metadata' MCP tool, including inline input schema (Zod) and handler function that proxies to Liveblocks API via callLiveblocksApi.
    server.tool(
      "edit-thread-metadata",
      `Edit a Liveblocks thread's metadata. \`null\` can be used to remove a key.`,
      {
        roomId: z.string(),
        threadId: z.string(),
        data: z.object({
          metadata: z.record(
            z.string(),
            z.union([z.string(), z.boolean(), z.number(), z.null()])
          ),
          userId: z.string(),
          updatedAt: z.date().optional(),
        }),
      },
      async ({ roomId, threadId, data }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().editThreadMetadata(
            { roomId, threadId, data },
            { signal: extra.signal }
          )
        );
      }
    );
  • The handler function executes the tool logic by calling the Liveblocks editThreadMetadata API and formatting the response.
    async ({ roomId, threadId, data }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().editThreadMetadata(
          { roomId, threadId, data },
          { signal: extra.signal }
        )
      );
    }
  • Inline Zod schema defining the input parameters for the edit-thread-metadata tool.
      roomId: z.string(),
      threadId: z.string(),
      data: z.object({
        metadata: z.record(
          z.string(),
          z.union([z.string(), z.boolean(), z.number(), z.null()])
        ),
        userId: z.string(),
        updatedAt: z.date().optional(),
      }),
    },
  • Shared helper function used by the handler to execute Liveblocks API calls and format MCP tool responses.
    export async function callLiveblocksApi(
      liveblocksPromise: Promise<any>
    ): Promise<CallToolResult> {
      try {
        const data = await liveblocksPromise;
    
        if (!data) {
          return {
            content: [{ type: "text", text: "Success. No data returned." }],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: "Here is the data. If the user has no specific questions, return it in a JSON code block",
            },
            {
              type: "text",
              text: JSON.stringify(data, null, 2),
            },
          ],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: "" + err,
            },
          ],
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions that 'null' can remove a key, which is useful context about mutation behavior. However, it doesn't disclose critical aspects like required permissions, whether changes are reversible, rate limits, error conditions, or what happens to existing metadata not mentioned. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences that each earn their place. The first sentence states the core purpose, and the second provides important behavioral nuance about null values. There's zero wasted language, and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations, 0% schema description coverage, complex nested parameters, and no output schema, the description is incomplete. It should explain more about the mutation's effects, required permissions, error handling, and the purpose of each parameter. The current description leaves too many gaps for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 3 parameters (including a complex nested object), the description adds minimal value. It only explains that 'null' can remove a metadata key, which relates to the 'metadata' property within 'data'. It doesn't clarify what 'roomId', 'threadId', or the other 'data' properties ('userId', 'updatedAt') represent or how they should be used. The description fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Edit') and resource ('a Liveblocks thread's metadata'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'update-room' or 'edit-comment' by specifying thread metadata editing. However, it doesn't explicitly contrast with all possible alternatives like 'update-room' which might also handle metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools like 'update-room', 'edit-comment', and 'mark-thread-as-resolved', there's no indication of when thread metadata editing is appropriate versus other thread or room operations. No prerequisites or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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