Skip to main content
Glama

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
NameRequiredDescriptionDefault
channel_idYesThe ID of the stream

Implementation Reference

  • 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) }],
      };
    }
  • 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"],
      },
    };
  • 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,
        ],
      };
    });
  • TypeScript interface defining input arguments for zulip_get_topics tool.
    interface GetTopicsArgs {
      channel_id: number;
    }

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