Skip to main content
Glama
liveblocks
by liveblocks

get-notification-settings

Retrieve notification settings for a specific user in Liveblocks by providing their user ID. Simplify configuration management for real-time collaboration.

Instructions

Get a Liveblocks notification settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Implementation Reference

  • src/server.ts:758-772 (registration)
    Registration of the 'get-notification-settings' tool including inline input schema (userId: string) and handler function that calls the Liveblocks API to retrieve notification settings for a user.
    server.tool( "get-notification-settings", "Get a Liveblocks notification settings", { userId: z.string(), }, async ({ userId }, extra) => { return await callLiveblocksApi( getLiveblocks().getNotificationSettings( { userId }, { signal: extra.signal } ) ); } );
  • The handler function executes the tool logic by calling getLiveblocks().getNotificationSettings with the provided userId, wrapped in callLiveblocksApi.
    async ({ userId }, extra) => { return await callLiveblocksApi( getLiveblocks().getNotificationSettings( { userId }, { signal: extra.signal } ) ); } );
  • Input schema for the tool: requires a 'userId' string.
    { userId: z.string(), },
  • Helper function callLiveblocksApi used by the handler to wrap API calls, format responses as text with JSON, or handle 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, }, ], }; } }
  • Helper function getLiveblocks() that initializes and returns the Liveblocks client instance.
    function getLiveblocks() { if (!client) { client = new Liveblocks({ secret: process.env.LIVEBLOCKS_SECRET_KEY as string, }); } return client; }

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