Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

update-room

Modify room permissions and metadata to control access for users, groups, or default settings in collaborative Liveblocks environments.

Instructions

Update a Liveblocks room

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
defaultAccessesYesThe default access permissions for the room. Permissions can be: 1. ["room:write"] // public 2. ["room:read", "room:presence:write"] // read-only 3. [] // private
groupsAccessesNo The group ID accesses for the room. Permissions can be: 1. ["room:write"] // public 2. ["room:read", "room:presence:write"] // read-only 3. [] // private For example, when setting a "design" group to have full/public access: { design: ["room:write"] } Setting to null is used to remove an existing access level: { design: null }
usersAccessesNo The user ID accesses for the room. Permissions can be: 1. ["room:write"] // public 2. ["room:read", "room:presence:write"] // read-only 3. [] // private For example, when setting "charlie" user ID to have full/public access: { charlie: ["room:write"] } Setting to null is used to remove an existing access level: { charlie: null }
metadataNo

Implementation Reference

  • The handler function for the 'update-room' tool. It extracts parameters, calls the Liveblocks updateRoom method with the provided accesses and metadata, and wraps the result using callLiveblocksApi.
      async (
        { roomId, defaultAccesses, groupsAccesses, usersAccesses, metadata },
        extra
      ) => {
        return await callLiveblocksApi(
          getLiveblocks().updateRoom(
            roomId,
            {
              defaultAccesses: defaultAccesses as any,
              groupsAccesses: groupsAccesses as any,
              usersAccesses: usersAccesses as any,
              metadata,
            },
            { signal: extra.signal }
          )
        );
      }
    );
  • Input schema definition for the 'update-room' tool using Zod, referencing shared access schemas.
    {
      roomId: z.string(),
      defaultAccesses: DefaultAccesses,
      groupsAccesses: GroupsAccesses.optional(),
      usersAccesses: UsersAccesses.optional(),
      metadata: z.record(z.string(), z.union([z.string(), z.null()])).optional(),
    },
  • src/server.ts:103-130 (registration)
    Registration of the 'update-room' tool on the MCP server instance.
    server.tool(
      "update-room",
      "Update a Liveblocks room",
      {
        roomId: z.string(),
        defaultAccesses: DefaultAccesses,
        groupsAccesses: GroupsAccesses.optional(),
        usersAccesses: UsersAccesses.optional(),
        metadata: z.record(z.string(), z.union([z.string(), z.null()])).optional(),
      },
      async (
        { roomId, defaultAccesses, groupsAccesses, usersAccesses, metadata },
        extra
      ) => {
        return await callLiveblocksApi(
          getLiveblocks().updateRoom(
            roomId,
            {
              defaultAccesses: defaultAccesses as any,
              groupsAccesses: groupsAccesses as any,
              usersAccesses: usersAccesses as any,
              metadata,
            },
            { signal: extra.signal }
          )
        );
      }
    );
  • Shared Zod schema for defaultAccesses parameter used in 'update-room' tool.
    export const DefaultAccesses = z.array(z.string()).describe(
      `The default access permissions for the room. Permissions can be: 
            
            1. ["room:write"] // public
            2. ["room:read", "room:presence:write"] // read-only
            3. [] // private        
        `
    );
  • Utility function used by the 'update-room' handler to call Liveblocks API and format the MCP tool response.
    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 but offers minimal information. It states this is an update operation (implying mutation) but doesn't mention required permissions, whether changes are reversible, rate limits, error conditions, or what happens to existing room properties not mentioned in the update. 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 maximally concise with a single sentence containing exactly 5 words. Every word earns its place by specifying the action and target resource without any redundancy or unnecessary elaboration. It's perfectly front-loaded with the essential information.

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 5 parameters, no annotations, no output schema, and moderate schema description coverage (60%), the description is insufficiently complete. It doesn't explain what 'updating a room' entails beyond the basic verb, doesn't mention behavioral aspects like permissions or side effects, and provides no context about the update operation's scope or limitations.

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

Parameters4/5

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

The description doesn't mention any parameters, but the input schema has 60% description coverage with detailed explanations for defaultAccesses, groupsAccesses, and usersAccesses parameters. The schema descriptions provide clear examples and permission options, while metadata and roomId lack descriptions. Since schema coverage is moderate (60%) and the description adds no parameter information, a baseline score of 3 is appropriate, but the schema's quality documentation for most parameters elevates this to 4.

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 ('Update') and resource ('a Liveblocks room'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'update-room-id' or 'update-room-subscription-settings' that also modify room properties, leaving some ambiguity about when to choose this specific update tool.

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 multiple room-related update tools in the sibling list (update-room-id, update-room-subscription-settings), there's no indication of which specific room properties this tool modifies versus others. No prerequisites, constraints, or typical use cases 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