Skip to main content
Glama
liveblocks

Liveblocks

Official
by liveblocks

update-room-subscription-settings

Modify notification preferences for threads and mentions in a Liveblocks collaborative room to control user alerts.

Instructions

Update a Liveblocks room's subscription settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdYes
userIdYes
dataYes

Implementation Reference

  • src/server.ts:596-621 (registration)
    Registration of the 'update-room-subscription-settings' tool, including inline input schema (Zod) and handler function that invokes the Liveblocks SDK's updateRoomSubscriptionSettings method wrapped in callLiveblocksApi.
    server.tool(
      "update-room-subscription-settings",
      `Update a Liveblocks room's subscription settings`,
      {
        roomId: z.string(),
        userId: z.string(),
        data: z.object({
          threads: z
            .union([
              z.literal("all"),
              z.literal("replies_and_mentions"),
              z.literal("none"),
            ])
            .optional(),
          textMentions: z.union([z.literal("mine"), z.literal("none")]).optional(),
        }),
      },
      async ({ roomId, userId, data }, extra) => {
        return await callLiveblocksApi(
          getLiveblocks().updateRoomSubscriptionSettings(
            { roomId, userId, data },
            { signal: extra.signal }
          )
        );
      }
    );
  • The core handler logic for executing the tool, which calls the Liveblocks API to update the subscription settings for a user in a room.
    async ({ roomId, userId, data }, extra) => {
      return await callLiveblocksApi(
        getLiveblocks().updateRoomSubscriptionSettings(
          { roomId, userId, data },
          { signal: extra.signal }
        )
      );
    }
  • Zod input schema defining parameters: roomId, userId, and data object with optional threads and textMentions settings.
    {
      roomId: z.string(),
      userId: z.string(),
      data: z.object({
        threads: z
          .union([
            z.literal("all"),
            z.literal("replies_and_mentions"),
            z.literal("none"),
          ])
          .optional(),
        textMentions: z.union([z.literal("mine"), z.literal("none")]).optional(),
      }),
    },

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