Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

create-room

Create a Liveblocks room with configurable access permissions for users and groups to enable real-time collaboration.

Instructions

Create 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 that executes the create-room tool logic. It calls the Liveblocks createRoom API with the provided roomId, access permissions, and metadata, wrapped in callLiveblocksApi for response formatting.
    async (
      { roomId, defaultAccesses, groupsAccesses, usersAccesses, metadata },
      extra
    ) => {
      return await callLiveblocksApi(
        getLiveblocks().createRoom(
          roomId,
          {
            defaultAccesses: defaultAccesses as any,
            groupsAccesses: groupsAccesses as any,
            usersAccesses: usersAccesses as any,
            metadata,
          },
          { signal: extra.signal }
        )
      );
    }
  • Input schema definition for the create-room tool parameters using Zod.
    {
      roomId: z.string(),
      defaultAccesses: DefaultAccesses,
      groupsAccesses: GroupsAccesses.optional(),
      usersAccesses: UsersAccesses.optional(),
      metadata: z.record(z.string(), z.string()).optional(),
    },
  • src/server.ts:61-88 (registration)
    Registration of the 'create-room' tool on the McpServer instance.
    server.tool(
      "create-room",
      "Create a Liveblocks room",
      {
        roomId: z.string(),
        defaultAccesses: DefaultAccesses,
        groupsAccesses: GroupsAccesses.optional(),
        usersAccesses: UsersAccesses.optional(),
        metadata: z.record(z.string(), z.string()).optional(),
      },
      async (
        { roomId, defaultAccesses, groupsAccesses, usersAccesses, metadata },
        extra
      ) => {
        return await callLiveblocksApi(
          getLiveblocks().createRoom(
            roomId,
            {
              defaultAccesses: defaultAccesses as any,
              groupsAccesses: groupsAccesses as any,
              usersAccesses: usersAccesses as any,
              metadata,
            },
            { signal: extra.signal }
          )
        );
      }
    );
  • Zod schema definition for defaultAccesses used in create-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        
        `
    );
  • Zod schema definition for groupsAccesses used in create-room tool.
    export const GroupsAccesses = z
      .record(z.string(), z.array(z.union([z.string(), z.null()])))
      .describe(
        `
          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
             }
          `
      );
  • Zod schema definition for usersAccesses used in create-room tool.
    export const UsersAccesses = z.record(
      z.string(),
      z.array(z.union([z.string(), z.null()]))
    ).describe(`
          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
             }
          `);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the action ('Create') without explaining what creation entails. It doesn't mention authentication requirements, rate limits, whether the operation is idempotent, what happens on duplicate roomId, or what the response contains. For a creation tool with zero annotation coverage, this is insufficient.

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, clear sentence that front-loads the essential information. There's zero wasted verbiage or redundancy. Every word earns its place.

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 creation tool with 5 parameters, nested objects, no annotations, and no output schema, the description is inadequate. It doesn't explain what a 'Liveblocks room' is, what happens after creation, error conditions, or return values. The agent lacks sufficient context to use this tool effectively beyond basic parameter passing.

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's in the schema. With 60% schema description coverage (3 of 5 parameters have descriptions), the baseline is 3. The description doesn't compensate for the 40% gap (roomId and metadata parameters lack schema descriptions) or provide additional context about parameter relationships or usage patterns.

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 ('Create') and resource ('a Liveblocks room'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'update-room' or explain what distinguishes creating a room from updating one, which prevents a perfect score.

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 like 'update-room' or 'get-room'. There's no mention of prerequisites, constraints, or typical use cases. The agent must infer usage from the tool name alone.

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