zulip_list_channels
Retrieve available channels (streams) from a Zulip organization, with options to filter by privacy settings and subscription status.
Instructions
List available channels (streams) in the Zulip organization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_private | No | Whether to include private streams | |
| include_web_public | No | Whether to include web-public streams | |
| include_subscribed | No | Whether to include streams the bot is subscribed to |
Implementation Reference
- index.ts:408-418 (handler)Handler logic for executing the zulip_list_channels tool: casts arguments to ListChannelsArgs and calls zulipClient.getStreams to fetch channels.case "zulip_list_channels": { const args = request.params.arguments as unknown as ListChannelsArgs; const response = await zulipClient.getStreams( args.include_private, args.include_web_public, args.include_subscribed ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:70-89 (schema)Input schema for zulip_list_channels tool defining optional boolean parameters to filter the list of channels.inputSchema: { type: "object", properties: { include_private: { type: "boolean", description: "Whether to include private streams", default: false, }, include_web_public: { type: "boolean", description: "Whether to include web-public streams", default: true, }, include_subscribed: { type: "boolean", description: "Whether to include streams the bot is subscribed to", default: true, }, }, },
- index.ts:67-90 (registration)Registration of the zulip_list_channels tool as a Tool object, including name, description, and schema; returned in ListTools response.const listChannelsTool: Tool = { name: "zulip_list_channels", description: "List available channels (streams) in the Zulip organization", inputSchema: { type: "object", properties: { include_private: { type: "boolean", description: "Whether to include private streams", default: false, }, include_web_public: { type: "boolean", description: "Whether to include web-public streams", default: true, }, include_subscribed: { type: "boolean", description: "Whether to include streams the bot is subscribed to", default: true, }, }, }, };
- index.ts:29-33 (helper)Type definition for arguments used in zulip_list_channels handler.interface ListChannelsArgs { include_private?: boolean; include_web_public?: boolean; include_subscribed?: boolean; }
- index.ts:240-261 (helper)Core helper method in ZulipClient that implements channel listing by retrieving streams from Zulip API with filter parameters.async getStreams(includePrivate = false, includeWebPublic = true, includeSubscribed = true) { try { const params: any = {}; if (includePrivate) { params.include_private = true; } if (!includeWebPublic) { params.include_web_public = false; } if (!includeSubscribed) { params.include_subscribed = false; } return await this.client.streams.retrieve(params); } catch (error) { console.error("Error getting streams:", error); throw error; } }