Skip to main content
Glama

get-subscribed-streams

Retrieve subscribed Zulip conversation spaces to identify available channels before sending messages. Lists streams with optional subscriber information.

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
NameRequiredDescriptionDefault
include_subscribersNoInclude subscriber lists for streams

Implementation Reference

  • The inline async handler function for the get-subscribed-streams tool. It calls ZulipClient.getSubscriptions, maps the streams data, and returns a formatted JSON response or error.
    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'}`);
      }
    }
  • Zod input schema for get-subscribed-streams tool defining optional include_subscribers parameter.
    export const GetSubscribedStreamsSchema = z.object({
      include_subscribers: z.boolean().optional().describe("Include subscriber lists for streams")
    });
  • src/server.ts:757-778 (registration)
    Registration of the get-subscribed-streams tool in McpServer using server.tool() with name, description, schema, and 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'}`);
        }
      }
    );
  • ZulipClient.getSubscriptions method that performs the actual API call to /users/me/subscriptions to fetch the 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;
    }

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/avisekrath/zulip-mcp-server'

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