Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

get-user-room-subscription-settings

Retrieve user subscription settings for Liveblocks rooms to manage access and permissions.

Instructions

Get a user's room subscription settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Implementation Reference

  • src/server.ts:640-654 (registration)
    Registration of the MCP tool 'get-user-room-subscription-settings' using server.tool, specifying the name, description, Zod input schema, and inline async handler function that calls the Liveblocks API.
    server.tool(
      "get-user-room-subscription-settings",
      `Get a user's room subscription settings`,
      {
        userId: z.string(),
      },
      async ({ userId }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().getUserRoomSubscriptionSettings(
            { userId },
            { signal: extra.signal }
          )
        );
      }
    );
  • Inline handler function implementing the tool logic: calls getLiveblocks().getUserRoomSubscriptionSettings with the userId and formats the response using callLiveblocksApi.
    async ({ userId }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().getUserRoomSubscriptionSettings(
          { userId },
          { signal: extra.signal }
        )
      );
    }
  • Zod schema for tool input parameters: requires a 'userId' string.
    {
      userId: z.string(),
    },
  • Helper function that lazily creates and returns a Liveblocks client instance using the LIVEBLOCKS_SECRET_KEY environment variable.
    function getLiveblocks() {
      if (!client) {
        client = new Liveblocks({
          secret: process.env.LIVEBLOCKS_SECRET_KEY as string,
        });
      }
      return client;
    }
  • Helper utility that executes a Liveblocks API promise, handles success by returning formatted JSON in MCP content or error message, used by all tools.
    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 the full burden of behavioral disclosure. It states 'Get', implying a read-only operation, but doesn't specify permissions required, rate limits, error conditions, or what the return data looks like. For a tool with no annotation coverage, this is a significant gap in transparency.

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, clear sentence with no wasted words. It is front-loaded and efficiently conveys the core purpose without unnecessary elaboration, making it easy for an agent 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 of a user-specific settings retrieval tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks details on authentication, response format, error handling, and how it differs from similar sibling tools, making it inadequate for reliable agent 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 mentions 'user's room subscription settings', which implies the 'userId' parameter is needed to identify the user, adding some semantic context beyond the schema's 0% description coverage. However, it doesn't clarify the format or constraints of 'userId' (e.g., whether it's an email, ID, or something else), so it only partially compensates for the 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 verb 'Get' and the resource 'user's room subscription settings', making the purpose specific and understandable. However, it doesn't distinguish this tool from its sibling 'get-room-subscription-settings', which appears to be a similar tool without the user focus, leaving room for confusion about when to use one versus the other.

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 sibling tools like 'get-room-subscription-settings' and 'update-room-subscription-settings' present, there is no indication of prerequisites, context, or distinctions, leaving the agent to infer usage based on tool names 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