Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

get-room

Retrieve a Liveblocks room to access real-time collaboration data and manage collaborative sessions by providing the room identifier.

Instructions

Get a Liveblocks room

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes

Implementation Reference

  • The core handler function for the 'get-room' tool. It takes roomId, calls getLiveblocks().getRoom via callLiveblocksApi utility.
    async ({ roomId }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().getRoom(roomId, { signal: extra.signal })
      );
    }
  • Zod input schema for the tool, requiring a 'roomId' string parameter.
    {
      roomId: z.string(),
    },
  • src/server.ts:90-101 (registration)
    Registration of the 'get-room' tool on the MCP server instance, specifying name, description, schema, and handler.
    server.tool(
      "get-room",
      "Get a Liveblocks room",
      {
        roomId: z.string(),
      },
      async ({ roomId }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().getRoom(roomId, { signal: extra.signal })
        );
      }
    );
  • Helper function to lazily initialize and return the singleton Liveblocks server client.
    let client: Liveblocks;
    
    function getLiveblocks() {
      if (!client) {
        client = new Liveblocks({
          secret: process.env.LIVEBLOCKS_SECRET_KEY as string,
        });
      }
      return client;
    }
  • Utility function used by all tools to execute a Liveblocks API promise and format the result as MCP CallToolResult content (JSON or error).
    import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
    
    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?

No annotations are provided, so the description carries full burden. It states 'Get a Liveblocks room' but doesn't disclose behavioral traits such as whether this is a read-only operation, what data is returned (e.g., metadata, status), error conditions (e.g., invalid room ID), or performance aspects (e.g., rate limits). The description is minimal and lacks essential operational context.

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, efficient sentence with zero waste. It's front-loaded and directly states the tool's function without unnecessary words, making it easy to parse quickly.

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 the complexity (a read operation with no annotations and no output schema), the description is incomplete. It doesn't explain what 'getting a room' entails (e.g., returns room details, configuration, or status), potential side effects, or error handling. For a tool in a collaborative environment like Liveblocks, more context is needed to use it effectively.

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 input schema has 1 parameter with 0% description coverage, so the description must compensate. It doesn't add any meaning beyond the schema—no explanation of what 'roomId' represents, its format, or where to obtain it. However, with only one parameter, the baseline is higher; the description doesn't worsen understanding but fails to enhance it.

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 verb ('Get') and resource ('a Liveblocks room'), making the purpose immediately understandable. It distinguishes from siblings like 'get-rooms' (plural) by specifying retrieval of a single room, but doesn't explicitly contrast with other read operations like 'get-thread' or 'get-comment'.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid room ID), contrast with 'get-rooms' for listing multiple rooms, or specify use cases like retrieving room metadata versus active data. The description offers only the basic function without 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