delete-notification-settings
Remove notification settings for a specific user in Liveblocks. This tool deletes all associated notification preferences, ensuring clean user management.
Instructions
Delete Liveblocks notification settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Implementation Reference
- src/server.ts:809-816 (handler)Handler function that executes the tool logic: calls the Liveblocks SDK's deleteNotificationSettings method via callLiveblocksApi utility, passing the userId and abort signal.async ({ userId }, extra) => { return await callLiveblocksApi( getLiveblocks().deleteNotificationSettings( { userId }, { signal: extra.signal } ) ); }
- src/server.ts:806-808 (schema)Input schema validation using Zod: requires a single 'userId' string parameter.{ userId: z.string(), },
- src/server.ts:803-805 (registration)Registration of the 'delete-notification-settings' tool on the MCP server instance, including name, description, schema, and handler.server.tool( "delete-notification-settings", "Delete Liveblocks notification settings",
- src/utils.ts:3-37 (helper)Shared helper utility used by the handler (and other tools) to execute Liveblocks API promises and format the results as MCP CallToolResult content blocks, handling success with JSON and errors appropriately.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, }, ], }; } }