Skip to main content
Glama

zulip_subscribe_to_channel

Subscribe a bot to a Zulip channel (stream) to enable message posting and interaction within that specific workspace communication channel.

Instructions

Subscribe the bot to a channel (stream)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_nameYesThe name of the stream to subscribe to

Implementation Reference

  • Executes the zulip_subscribe_to_channel tool by parsing arguments, validating channel_name, and delegating to the ZulipClient's subscribeToStream method.
    case "zulip_subscribe_to_channel": { const args = request.params.arguments as unknown as SubscribeToChannelArgs; if (!args.channel_name) { throw new Error("Missing required argument: channel_name"); } const response = await zulipClient.subscribeToStream(args.channel_name); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
  • Defines the Tool metadata, description, and input schema requiring 'channel_name' for the zulip_subscribe_to_channel tool.
    const subscribeToChannelTool: Tool = { name: "zulip_subscribe_to_channel", description: "Subscribe the bot to a channel (stream)", inputSchema: { type: "object", properties: { channel_name: { type: "string", description: "The name of the stream to subscribe to", }, }, required: ["channel_name"], }, };
  • Core helper method in ZulipClient that performs the actual subscription to the specified stream using the Zulip JS SDK.
    async subscribeToStream(streamName: string) { try { const subscriptions = [{ name: streamName }]; return await this.client.streams.subscribe({ subscriptions: JSON.stringify(subscriptions) }); } catch (error) { console.error("Error subscribing to stream:", error); throw error; } }
  • index.ts:535-549 (registration)
    Registers the zulip_subscribe_to_channel tool (as subscribeToChannelTool) in the ListTools response.
    server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: [ listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ], }; });

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/Monadical-SAS/zulip-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server