Skip to main content
Glama

get-stream-id

Retrieve the numeric ID of a Zulip stream using its name to enable API operations requiring stream identification.

Instructions

🔢 STREAM ID LOOKUP: Get the numeric ID of a stream (channel) when you know its name. Use this to get the stream ID needed for other operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stream_nameYesName of the stream to get ID for

Implementation Reference

  • MCP tool registration and handler for 'get-stream-id'. Registers the tool with server.tool(), provides description and schema, and implements the handler logic that calls ZulipClient.getStreamId(stream_name) and formats the response.
    server.tool(
      "get-stream-id",
      "🔢 STREAM ID LOOKUP: Get the numeric ID of a stream (channel) when you know its name. Use this to get the stream ID needed for other operations.",
      GetStreamIdSchema.shape,
      async ({ stream_name }) => {
        try {
          const result = await zulipClient.getStreamId(stream_name);
          return createSuccessResponse(JSON.stringify({
            stream_name,
            stream_id: result.stream_id
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error getting stream ID: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • Zod schema defining the input parameters for the get-stream-id tool: requires 'stream_name' string.
    export const GetStreamIdSchema = z.object({
      stream_name: z.string().describe("Name of the stream to get ID for")
    });
  • ZulipClient helper method that performs the actual Zulip API call to retrieve stream ID by name via GET /get_stream_id?stream={streamName}.
    async getStreamId(streamName: string): Promise<{ stream_id: number }> {
      const response = await this.client.get('/get_stream_id', {
        params: { stream: streamName }
      });
      return response.data;
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the tool's behavior as a lookup operation that returns a numeric ID, which implies it's read-only and non-destructive. However, it doesn't mention potential errors (e.g., if the stream name doesn't exist), rate limits, authentication needs, or the format of the return value. The description adds basic context but misses key behavioral details for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is front-loaded with the core purpose in the first sentence and uses a second sentence to explain usage context. Both sentences earn their place by clarifying the tool's role and utility without redundancy. The emoji and formatting (🔢 STREAM ID LOOKUP) add visual emphasis without detracting from clarity, making it efficiently structured.

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?

Given the tool's low complexity (one parameter, no annotations, no output schema), the description is somewhat complete but has gaps. It explains the purpose and basic usage but lacks details on error handling, return format, or prerequisites. For a simple lookup tool, this is adequate but not fully comprehensive, as it doesn't compensate for the absence of annotations or output schema.

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%, with the single parameter 'stream_name' fully documented in the schema. The description adds minimal value beyond the schema by implying the parameter is required ('when you know its name') but doesn't provide additional semantics like format constraints or examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 specific action ('Get the numeric ID of a stream') and resource ('when you know its name'), distinguishing it from sibling tools like 'get-stream-by-id' (which presumably does the reverse) and 'get-subscribed-streams' (which lists streams). It uses a precise verb ('Get') and specifies the input condition ('when you know its name').

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 provides clear context for when to use this tool ('when you know its name') and hints at its purpose ('needed for other operations'), but it does not explicitly state when not to use it or name specific alternatives. For example, it doesn't clarify if 'get-stream-by-id' is the inverse operation or when to use 'get-subscribed-streams' instead. This is helpful but lacks explicit exclusions or named alternatives.

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