get-subscribed-streams
Retrieve all channels you are subscribed to in your Zulip workspace to view available conversation spaces before sending messages.
Instructions
📺 USER STREAMS: Get all streams you're subscribed to. Use this to see what streams are available before sending messages. Note: In Zulip, 'streams' and 'channels' refer to the same thing - conversation spaces for teams.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_subscribers | No | Include subscriber lists for streams |
Implementation Reference
- src/server.ts:756-778 (registration)Tool registration for 'get-subscribed-streams' using the MCP server.tool() call, with description and schema reference.
server.tool( "get-subscribed-streams", "📺 USER STREAMS: Get all streams you're subscribed to. Use this to see what streams are available before sending messages. Note: In Zulip, 'streams' and 'channels' refer to the same thing - conversation spaces for teams.", GetSubscribedStreamsSchema.shape, async ({ include_subscribers }) => { try { const result = await zulipClient.getSubscriptions(include_subscribers); return createSuccessResponse(JSON.stringify({ subscription_count: result.subscriptions.length, subscriptions: result.subscriptions.map(stream => ({ id: stream.stream_id, name: stream.name, description: stream.description, invite_only: stream.invite_only, is_archived: stream.is_archived, is_announcement_only: stream.is_announcement_only })) }, null, 2)); } catch (error) { return createErrorResponse(`Error getting subscribed streams: ${error instanceof Error ? error.message : 'Unknown error'}`); } } ); - src/server.ts:760-777 (handler)Handler function that calls zulipClient.getSubscriptions() and returns formatted stream data.
async ({ include_subscribers }) => { try { const result = await zulipClient.getSubscriptions(include_subscribers); return createSuccessResponse(JSON.stringify({ subscription_count: result.subscriptions.length, subscriptions: result.subscriptions.map(stream => ({ id: stream.stream_id, name: stream.name, description: stream.description, invite_only: stream.invite_only, is_archived: stream.is_archived, is_announcement_only: stream.is_announcement_only })) }, null, 2)); } catch (error) { return createErrorResponse(`Error getting subscribed streams: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/types.ts:238-240 (schema)Zod schema defining the input parameter: optional include_subscribers boolean.
export const GetSubscribedStreamsSchema = z.object({ include_subscribers: z.boolean().optional().describe("Include subscriber lists for streams") }); - src/zulip/client.ts:332-336 (helper)ZulipClient.getSubscriptions() method that calls the Zulip API endpoint /users/me/subscriptions.
async getSubscriptions(includeSubscribers?: boolean): Promise<{ subscriptions: ZulipStream[] }> { const params = includeSubscribers ? { include_subscribers: true } : {}; const response = await this.client.get('/users/me/subscriptions', { params }); return response.data; } - src/types.ts:41-57 (helper)ZulipStream interface defining the shape of stream objects returned by the API.
export interface ZulipStream { stream_id: number; name: string; description: string; invite_only: boolean; is_web_public: boolean; is_archived: boolean; creator_id: number; date_created: number; first_message_id: number; message_retention_days: number | null; history_public_to_subscribers: boolean; rendered_description: string; is_announcement_only: boolean; can_remove_subscribers_group: number; stream_post_policy: number; }