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;
    }

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