Skip to main content
Glama

get-stream-by-id

Retrieve detailed information about a Zulip stream using its numeric ID, including settings, description, and subscriber data.

Instructions

📊 STREAM DETAILS: Get comprehensive information about a stream (channel) when you have its numeric ID. Returns stream settings, description, subscriber count, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stream_idYesUnique stream ID to get details for
include_subscribersNoInclude subscriber list

Implementation Reference

  • The main tool handler function that destructures input parameters, calls the Zulip client to fetch stream data, formats the response with selected fields, and handles errors.
    async ({ stream_id, include_subscribers }) => {
      try {
        const result = await zulipClient.getStream(stream_id, include_subscribers);
        return createSuccessResponse(JSON.stringify({
          stream: {
            id: result.stream.stream_id,
            name: result.stream.name,
            description: result.stream.description,
            invite_only: result.stream.invite_only,
            is_web_public: result.stream.is_web_public,
            is_archived: result.stream.is_archived,
            is_announcement_only: result.stream.is_announcement_only,
            date_created: new Date(result.stream.date_created * 1000).toISOString()
          }
        }, null, 2));
      } catch (error) {
        return createErrorResponse(`Error getting stream by ID: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Zod schema defining the input parameters: required stream_id (number) and optional include_subscribers (boolean).
    export const GetStreamByIdSchema = z.object({
      stream_id: z.number().describe("Unique stream ID to get details for"),
      include_subscribers: z.boolean().optional().describe("Include subscriber list")
    });
  • src/server.ts:797-820 (registration)
    Registers the tool with the MCP server using server.tool(), providing the tool name, description, input schema, and inline handler function.
    server.tool(
      "get-stream-by-id",
      "📊 STREAM DETAILS: Get comprehensive information about a stream (channel) when you have its numeric ID. Returns stream settings, description, subscriber count, etc.",
      GetStreamByIdSchema.shape,
      async ({ stream_id, include_subscribers }) => {
        try {
          const result = await zulipClient.getStream(stream_id, include_subscribers);
          return createSuccessResponse(JSON.stringify({
            stream: {
              id: result.stream.stream_id,
              name: result.stream.name,
              description: result.stream.description,
              invite_only: result.stream.invite_only,
              is_web_public: result.stream.is_web_public,
              is_archived: result.stream.is_archived,
              is_announcement_only: result.stream.is_announcement_only,
              date_created: new Date(result.stream.date_created * 1000).toISOString()
            }
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error getting stream by ID: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • ZulipClient helper method that makes the actual HTTP GET request to Zulip API endpoint /streams/{streamId} to fetch stream details, optionally including subscribers.
    async getStream(streamId: number, includeSubscribers?: boolean): Promise<{ stream: ZulipStream }> {
      const params = includeSubscribers ? { include_subscribers: true } : {};
      const response = await this.client.get(`/streams/${streamId}`, { params });
      return response.data;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the tool returns 'comprehensive information' including 'stream settings, description, subscriber count, etc.', which gives useful behavioral context. However, it doesn't mention potential limitations like rate limits, authentication requirements, or error conditions. The disclosure is adequate but incomplete for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the purpose and prerequisite, the second describes the return content. The emoji and capitalization are slightly decorative but don't significantly impact readability. Every sentence earns its place, though it could be slightly more concise by combining ideas.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read tool with 2 parameters, 100% schema coverage, and no output schema, the description is reasonably complete. It covers the purpose, prerequisite, and return types. However, without annotations or output schema, it lacks details on response format, error handling, or behavioral constraints. It's adequate but has clear gaps in contextual information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. It implies stream_id is required and mentions subscriber count, which aligns with include_subscribers, but provides no additional syntax or format details. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('comprehensive information about a stream/channel'), specifies the required input ('when you have its numeric ID'), and distinguishes from siblings by focusing on stream details rather than listing streams (get-subscribed-streams) or getting stream IDs (get-stream-id). The emoji and capitalization add emphasis but don't detract from clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('when you have its numeric ID'), providing clear context. However, it doesn't mention when NOT to use it or name specific alternatives like get-subscribed-streams for listing streams without IDs. The guidance is helpful but lacks exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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