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
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ||
| kind | Yes | ||
| subjectId | Yes | ||
| activityData | Yes | Custom data related to the notification | |
| roomId | No | Don'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 } ) ); } );
- src/server.ts:715-722 (handler)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 } ) ); }
- src/server.ts:702-714 (schema)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"), },