Skip to main content
Glama

get-stream-id

Retrieve the numeric ID of a Zulip stream by providing its name, enabling operations that require the stream ID for channel management and message actions.

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 handler: extracts stream_name from input, calls ZulipClient.getStreamId, formats success/error responses.
    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 for get-stream-id tool input validation: requires stream_name string.
    export const GetStreamIdSchema = z.object({ stream_name: z.string().describe("Name of the stream to get ID for") });
  • src/server.ts:780-795 (registration)
    MCP server.tool registration for 'get-stream-id' tool with description, input schema, and handler.
    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'}`); } } );
  • ZulipClient helper method: makes API GET request to /get_stream_id?stream={streamName} to fetch stream ID.
    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