delete-inbox-notification
Remove specific inbox notifications from the Liveblocks server by specifying the user ID and notification ID to manage notification clutter effectively.
Instructions
Delete a Liveblocks inbox notification
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inboxNotificationId | Yes | ||
| userId | Yes |
Implementation Reference
- src/server.ts:732-739 (handler)The handler function that executes the delete-inbox-notification tool by calling the Liveblocks client's deleteInboxNotification method wrapped in callLiveblocksApi.async ({ userId, inboxNotificationId }, extra) => { return await callLiveblocksApi( getLiveblocks().deleteInboxNotification( { userId, inboxNotificationId }, { signal: extra.signal } ) ); }
- src/server.ts:728-731 (schema)Zod input schema for the tool parameters: userId and inboxNotificationId.{ userId: z.string(), inboxNotificationId: z.string(), },
- src/server.ts:725-740 (registration)Registration of the delete-inbox-notification tool on the MCP server, including description, schema, and inline handler.server.tool( "delete-inbox-notification", "Delete a Liveblocks inbox notification", { userId: z.string(), inboxNotificationId: z.string(), }, async ({ userId, inboxNotificationId }, extra) => { return await callLiveblocksApi( getLiveblocks().deleteInboxNotification( { userId, inboxNotificationId }, { signal: extra.signal } ) ); } );
- src/utils.ts:3-37 (helper)Utility function used by the handler to execute Liveblocks API calls and format the response as MCP CallToolResult, handling success, no data, and errors.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, }, ], }; } }
- src/server.ts:21-28 (helper)Helper function that initializes and returns the Liveblocks client instance used in the handler.function getLiveblocks() { if (!client) { client = new Liveblocks({ secret: process.env.LIVEBLOCKS_SECRET_KEY as string, }); } return client; }