Skip to main content
Glama

get-topics-in-stream

Retrieve recent conversation threads from a specific Zulip stream to browse active discussions and monitor ongoing 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

  • src/server.ts:581-601 (registration)
    Registration of the 'get-topics-in-stream' MCP tool, including description, input schema reference, and inline handler function that delegates to ZulipClient and formats the response.
    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'}`);
        }
      }
    );
  • Inline handler function for the tool: takes stream_id, fetches topics via ZulipClient, maps to summary format, and returns JSON response or error.
      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 schema defining the input parameter 'stream_id' (number) for the tool.
    export const GetStreamTopicsSchema = z.object({
      stream_id: z.number().describe("Unique stream ID to get topics for")
    });
  • ZulipClient helper method that performs the actual Zulip API call to retrieve topics for a given stream ID and returns raw API response.
    async getStreamTopics(streamId: number): Promise<{ topics: ZulipTopic[] }> {
      const response = await this.client.get(`/users/me/${streamId}/topics`);
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it implies a read-only operation ('Get'), it doesn't specify permissions needed, rate limits, pagination behavior, or what 'recent' means (timeframe/limit). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with two sentences: the first states the purpose, and the second provides usage context. Every word earns its place, and it's front-loaded with the core functionality. No wasted verbiage or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and usage but lacks behavioral details like permissions, limits, or return format. For a read operation with no output schema, more context on what 'topics' includes would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single parameter 'stream_id' with its type and description. The description doesn't add any parameter-specific information beyond what's in the schema, such as how to obtain stream IDs or format requirements. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('all recent topics in a specific stream'), making the purpose explicit. It distinguishes from siblings like 'get-messages' by focusing on topics/threads rather than individual messages. However, it doesn't explicitly differentiate from 'get-stream-by-id' or 'get-stream-id', which could cause confusion about stream identification.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to browse what's being discussed in a stream'), which is helpful for an agent. It doesn't explicitly state when NOT to use it or name specific alternatives, but the context is sufficient for basic decision-making. No misleading guidance is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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