Skip to main content
Glama
liveblocks
by liveblocks

get-inbox-notification

Retrieve specific inbox notifications by providing a userId and inboxNotificationId to monitor and manage updates within the Liveblocks system.

Instructions

Get a Liveblocks inbox notification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inboxNotificationIdYes
userIdYes

Implementation Reference

  • The handler function that implements the core logic of the 'get-inbox-notification' tool. It invokes the Liveblocks client's getInboxNotification method, wrapped by callLiveblocksApi, to fetch a specific inbox notification for the given user.
    async ({ userId, inboxNotificationId }, extra) => { return await callLiveblocksApi( getLiveblocks().getInboxNotification( { userId, inboxNotificationId }, { signal: extra.signal } ) ); }
  • src/server.ts:681-696 (registration)
    Registration of the 'get-inbox-notification' tool using McpServer.tool(), including inline input schema and handler function.
    server.tool( "get-inbox-notification", "Get a Liveblocks inbox notification", { userId: z.string(), inboxNotificationId: z.string(), }, async ({ userId, inboxNotificationId }, extra) => { return await callLiveblocksApi( getLiveblocks().getInboxNotification( { userId, inboxNotificationId }, { signal: extra.signal } ) ); } );
  • Inline Zod schema defining the input parameters: userId (string) and inboxNotificationId (string).
    { userId: z.string(), inboxNotificationId: z.string(), },
  • Helper function that lazily initializes and returns the Liveblocks Node.js client instance used by the tool handler.
    function getLiveblocks() { if (!client) { client = new Liveblocks({ secret: process.env.LIVEBLOCKS_SECRET_KEY as string, }); } return client; }
  • Utility function that executes a Liveblocks API promise, formats the successful response with JSON stringification in MCP content format, or returns error text.
    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, }, ], }; } }

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