Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

get-inbox-notifications

Retrieve recent notifications from Liveblocks inbox, with options to filter unread messages, paginate results, and limit output for user-specific updates.

Instructions

Get recent Liveblocks inbox notifications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes
queryNo
startingAfterNo
limitNo

Implementation Reference

  • The handler function for the 'get-inbox-notifications' tool. It calls the Liveblocks SDK's getInboxNotifications method, wrapped by callLiveblocksApi to format the response as MCP CallToolResult.
    async ({ userId, query, startingAfter, limit }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().getInboxNotifications(
          { userId, query, startingAfter, limit },
          { signal: extra.signal }
        )
      );
    }
  • Zod input schema for the tool parameters: required userId (string), optional query object with unread boolean, startingAfter string, and limit number.
    {
      userId: z.string(),
      query: z
        .object({
          unread: z.boolean(),
        })
        .optional(),
      startingAfter: z.string().optional(),
      limit: z.number().optional(),
    },
  • src/server.ts:658-679 (registration)
    Full registration of the 'get-inbox-notifications' tool on the MCP server instance using server.tool(), including name, description, input schema, and handler.
    server.tool(
      "get-inbox-notifications",
      `Get recent Liveblocks inbox notifications`,
      {
        userId: z.string(),
        query: z
          .object({
            unread: z.boolean(),
          })
          .optional(),
        startingAfter: z.string().optional(),
        limit: z.number().optional(),
      },
      async ({ userId, query, startingAfter, limit }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().getInboxNotifications(
            { userId, query, startingAfter, limit },
            { signal: extra.signal }
          )
        );
      }
    );
  • Helper function used by the handler to wrap Liveblocks API promises into MCP-compliant CallToolResult, formatting data as JSON on success or error message on failure.
    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,
            },
          ],
        };
      }
    }
  • Helper function that lazily initializes and returns the Liveblocks client instance using the secret key from environment.
    function getLiveblocks() {
      if (!client) {
        client = new Liveblocks({
          secret: process.env.LIVEBLOCKS_SECRET_KEY as string,
        });
      }
      return client;
    }
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. While 'Get' implies a read operation, the description doesn't specify whether this requires authentication, what permissions are needed, whether it's paginated (though parameters suggest it might be), what the return format looks like, or any rate limits. For a tool with 4 parameters and no annotation coverage, this leaves significant behavioral gaps.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a straightforward retrieval tool and front-loads the core purpose without unnecessary elaboration.

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 tool's moderate complexity (4 parameters including nested objects), complete lack of annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'recent' means, how notifications are structured, what authentication is required, or how parameters interact. For a tool that likely returns structured notification data, the description leaves too many contextual questions unanswered.

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

Parameters2/5

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

With 0% schema description coverage and 4 parameters (including a nested object), the description provides no information about any parameters. It doesn't explain what 'userId', 'query.unread', 'startingAfter', or 'limit' mean, their expected formats, or how they affect the retrieval. The description fails to compensate for the complete lack of schema documentation, leaving all parameters semantically opaque.

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 ('Liveblocks inbox notifications'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'get-inbox-notification' (singular) by implying it retrieves multiple notifications. However, it doesn't explicitly differentiate from other notification-related tools like 'delete-all-inbox-notifications' or 'trigger-inbox-notification' beyond the action verb.

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 siblings like 'get-inbox-notification' (singular), 'delete-all-inbox-notifications', and 'trigger-inbox-notification', there's no indication of when this bulk retrieval tool is appropriate versus fetching a single notification or performing other inbox operations. The description lacks any context about prerequisites, typical use cases, or exclusions.

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