zulip_get_topics
Retrieve conversation topics from a Zulip channel to access discussion threads and monitor ongoing conversations within a workspace.
Instructions
Get topics in a channel (stream)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | The ID of the stream |
Implementation Reference
- index.ts:487-496 (handler)Handler for the zulip_get_topics tool. Extracts channel_id from arguments, validates it, calls ZulipClient.getTopics, and returns the JSON response.case "zulip_get_topics": { const args = request.params.arguments as unknown as GetTopicsArgs; if (args.channel_id === undefined) { throw new Error("Missing required argument: channel_id"); } const response = await zulipClient.getTopics(args.channel_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:185-198 (schema)Tool schema definition for zulip_get_topics, including name, description, and input schema requiring channel_id.const getTopicsTool: Tool = { name: "zulip_get_topics", description: "Get topics in a channel (stream)", inputSchema: { type: "object", properties: { channel_id: { type: "number", description: "The ID of the stream", }, }, required: ["channel_id"], }, };
- index.ts:336-343 (helper)ZulipClient helper method that retrieves topics for a given stream_id using the Zulip API.async getTopics(streamId: number) { try { return await this.client.streams.topics.retrieve({ stream_id: streamId }); } catch (error) { console.error("Error getting topics:", error); throw error; } }
- index.ts:535-549 (registration)Registration of tools list including zulip_get_topics (via getTopicsTool) in the ListToolsRequest handler.server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: [ listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ], }; });
- index.ts:58-60 (schema)TypeScript interface defining input arguments for zulip_get_topics tool.interface GetTopicsArgs { channel_id: number; }