get-subscribed-streams
Retrieve all subscribed streams in a Zulip workspace to identify conversation spaces before sending messages. Optionally include subscriber lists for detailed stream insights.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_subscribers | No | Include subscriber lists for streams |
Implementation Reference
- src/server.ts:760-777 (handler)Handler function that executes the get-subscribed-streams tool logic: fetches subscriptions via ZulipClient and returns formatted list.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 input schema defining optional include_subscribers parameter for the tool.export const GetSubscribedStreamsSchema = z.object({ include_subscribers: z.boolean().optional().describe("Include subscriber lists for streams") });
- src/server.ts:757-778 (registration)MCP server.tool registration for get-subscribed-streams, including description, schema, and inline handler."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/zulip/client.ts:332-336 (helper)ZulipClient helper method that performs the API call to retrieve user's subscribed streams.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; }