Skip to main content
Glama

zulip_get_topics

Retrieve topics from a Zulip channel to organize and access conversation threads efficiently.

Instructions

Get topics in a channel (stream)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesThe ID of the stream

Implementation Reference

  • The main handler for the 'zulip_get_topics' tool within the CallToolRequest handler switch statement. It validates the channel_id argument and calls ZulipClient.getTopics.
    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) }], }; }
  • TypeScript interface defining the input arguments for the zulip_get_topics tool.
    interface GetTopicsArgs { channel_id: number; }
  • index.ts:185-198 (registration)
    Tool object definition including name, description, and input schema, used for registration.
    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"], }, };
  • Core helper method in ZulipClient that retrieves topics for a given stream_id using the Zulip client 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:538-548 (registration)
    Registration of the tool in the ListToolsRequest handler by including getTopicsTool in the returned tools array.
    tools: [ listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ], };

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/Monadical-SAS/zulip-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server