Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

trigger-inbox-notification

Send custom notifications to user inboxes in Liveblocks applications. Specify user, notification type, subject, and custom data to deliver targeted alerts.

Instructions

Create a custom Liveblocks inbox notification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes
kindYes
subjectIdYes
activityDataYesCustom data related to the notification
roomIdNoDon't add this unless specifically asked

Implementation Reference

  • src/server.ts:698-723 (registration)
    Registration of the 'trigger-inbox-notification' MCP tool using McpServer.tool method, including inline schema and handler function.
    server.tool(
      "trigger-inbox-notification",
      "Create a custom Liveblocks inbox notification",
      {
        userId: z.string(),
        kind: z.string().regex(/^\$/, {
          message: "String must start with '$'",
        }),
        subjectId: z.string(),
        activityData: z
          .record(z.string(), z.union([z.string(), z.boolean(), z.number()]))
          .describe("Custom data related to the notification"),
        roomId: z
          .string()
          .optional()
          .describe("Don't add this unless specifically asked"),
      },
      async ({ userId, kind, subjectId, activityData, roomId }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().triggerInboxNotification(
            { userId, kind: kind as `$${string}`, subjectId, activityData, roomId },
            { signal: extra.signal }
          )
        );
      }
    );
  • The handler function that executes the tool logic by calling the Liveblocks SDK's triggerInboxNotification via the callLiveblocksApi utility.
    async ({ userId, kind, subjectId, activityData, roomId }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().triggerInboxNotification(
          { userId, kind: kind as `$${string}`, subjectId, activityData, roomId },
          { signal: extra.signal }
        )
      );
    }
  • Inline Zod schema defining the input parameters for the 'trigger-inbox-notification' tool: userId, kind (custom starting with $), subjectId, activityData, and optional roomId.
      userId: z.string(),
      kind: z.string().regex(/^\$/, {
        message: "String must start with '$'",
      }),
      subjectId: z.string(),
      activityData: z
        .record(z.string(), z.union([z.string(), z.boolean(), z.number()]))
        .describe("Custom data related to the notification"),
      roomId: z
        .string()
        .optional()
        .describe("Don't add this unless specifically asked"),
    },
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 'Create' which implies a write/mutation operation, but doesn't disclose behavioral traits like permissions needed, rate limits, whether notifications are persistent or ephemeral, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 zero waste. It's appropriately sized and front-loaded with the essential action and resource. Every word earns its place without redundancy or 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 this is a mutation tool with 5 parameters, no annotations, no output schema, and only 40% schema description coverage, the description is incomplete. It doesn't provide enough context about what the tool actually does beyond the basic action, how it differs from similar tools, what the parameters mean, or what to expect as a result. The conciseness comes at the cost of necessary detail.

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?

Schema description coverage is only 40% (only 'activityData' and 'roomId' have descriptions). The tool description adds no parameter information beyond what's in the schema - it doesn't explain what 'userId', 'kind', or 'subjectId' mean, nor does it clarify the pattern requirement for 'kind' (^\$). With low coverage and 5 parameters, the description fails to compensate for the schema's deficiencies.

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 the resource 'custom Liveblocks inbox notification', which is specific and actionable. It distinguishes from siblings like 'delete-inbox-notification' or 'get-inbox-notification' by focusing on creation, but doesn't explicitly differentiate from other creation tools like 'create-room' or 'create-comment' beyond the notification context.

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 many sibling tools (e.g., 'broadcast-event', 'create-room'), there's no indication of scenarios where this notification tool is preferred or prerequisites for its use. The only implicit usage hint is in the input schema's 'roomId' description, but that's not part of the tool description itself.

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