Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

delete-thread

Remove a specific thread from a Liveblocks room to manage collaborative content and maintain organized workspaces.

Instructions

Delete a Liveblocks thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
threadIdYes

Implementation Reference

  • The handler function for the 'delete-thread' tool. It destructures roomId and threadId from input, then calls the Liveblocks SDK's deleteThread method wrapped in callLiveblocksApi to handle the API response formatting.
    async ({ roomId, threadId }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().deleteThread(
          { roomId, threadId },
          { signal: extra.signal }
        )
      );
    }
  • Zod input schema for the 'delete-thread' tool, requiring roomId and threadId as strings.
    {
      roomId: z.string(),
      threadId: z.string(),
    },
  • src/server.ts:378-393 (registration)
    Registration of the 'delete-thread' tool on the McpServer instance, including name, description, schema, and handler.
    server.tool(
      "delete-thread",
      "Delete a Liveblocks thread",
      {
        roomId: z.string(),
        threadId: z.string(),
      },
      async ({ roomId, threadId }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().deleteThread(
            { roomId, threadId },
            { signal: extra.signal }
          )
        );
      }
    );
  • Helper function that lazily initializes and returns the Liveblocks Node.js SDK client used by the handler.
    function getLiveblocks() {
      if (!client) {
        client = new Liveblocks({
          secret: process.env.LIVEBLOCKS_SECRET_KEY as string,
        });
      }
      return client;
    }
  • Helper function that wraps Liveblocks API promises, formatting successful responses as MCP CallToolResult with JSON and handling errors.
    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 the full burden of behavioral disclosure. It states the tool performs a deletion but doesn't specify whether this is permanent, reversible, requires specific permissions, or has side effects (e.g., deleting associated comments). This is inadequate for a destructive operation with zero annotation coverage.

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 a single, direct sentence with no unnecessary words. It front-loads the core action and resource efficiently, making it easy to parse without wasted verbiage.

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?

For a destructive tool with no annotations, no output schema, and low parameter documentation, the description is incomplete. It lacks critical details such as behavioral traits (e.g., permanence, permissions), return values, and error conditions, which are essential for safe and effective use.

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

Parameters3/5

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

The description adds no parameter information beyond what the input schema provides. With 0% schema description coverage, the two required parameters (roomId, threadId) are undocumented in both schema and description. However, the baseline is 3 when schema coverage is high, but here it's low, so the description fails to compensate, resulting in a minimal score.

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 ('Delete') and the resource ('a Liveblocks thread'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'delete-comment' or 'delete-room', which follow the same pattern for different resources.

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. It doesn't mention prerequisites (e.g., thread existence), exclusions, or relationships with sibling tools like 'delete-room' or 'mark-thread-as-resolved', leaving the agent to infer usage context.

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