Skip to main content
Glama

get-topics-in-stream

Retrieve recent conversation threads in a specific Zulip stream using the stream ID. Quickly browse active discussions to stay informed on relevant topics.

Instructions

💬 STREAM TOPICS: Get all recent topics (conversation threads) in a specific stream (channel). Use this to browse what's being discussed in a stream.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stream_idYesUnique stream ID to get topics for

Implementation Reference

  • MCP tool handler: extracts stream_id, calls ZulipClient.getStreamTopics, formats response with topic list including names and max_id.
    async ({ stream_id }) => { try { const result = await zulipClient.getStreamTopics(stream_id); return createSuccessResponse(JSON.stringify({ stream_id, topic_count: result.topics.length, topics: result.topics.map(topic => ({ name: topic.name, max_id: topic.max_id })) }, null, 2)); } catch (error) { return createErrorResponse(`Error getting stream topics: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
  • src/server.ts:581-601 (registration)
    Tool registration with MCP server: defines name, description, input schema, and handler function.
    server.tool( "get-topics-in-stream", "💬 STREAM TOPICS: Get all recent topics (conversation threads) in a specific stream (channel). Use this to browse what's being discussed in a stream.", GetStreamTopicsSchema.shape, async ({ stream_id }) => { try { const result = await zulipClient.getStreamTopics(stream_id); return createSuccessResponse(JSON.stringify({ stream_id, topic_count: result.topics.length, topics: result.topics.map(topic => ({ name: topic.name, max_id: topic.max_id })) }, null, 2)); } catch (error) { return createErrorResponse(`Error getting stream topics: ${error instanceof Error ? error.message : 'Unknown error'}`); } } );
  • Zod input schema validation: requires 'stream_id' as a number.
    export const GetStreamTopicsSchema = z.object({ stream_id: z.number().describe("Unique stream ID to get topics for") });
  • ZulipClient helper method: performs the actual API request to retrieve topics for a stream.
    async getStreamTopics(streamId: number): Promise<{ topics: ZulipTopic[] }> { const response = await this.client.get(`/users/me/${streamId}/topics`); 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