Skip to main content
Glama

get-message

Retrieve complete details for a specific Zulip message using its ID to analyze content, edit history, reactions, and metadata.

Instructions

🔍 SINGLE MESSAGE: Get complete details about one specific message when you have its ID. Use this for in-depth analysis, checking edit history, reactions, or metadata. Returns single message with full details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYesUnique message ID to retrieve
apply_markdownNoReturn HTML content (true) or raw Markdown (false). Default: true
allow_empty_topic_nameNoAllow empty topic names in response (default: false)

Implementation Reference

  • Handler function for the 'get-message' tool. Fetches a single message by ID using the ZulipClient, formats the response, and handles errors.
    async ({ message_id, apply_markdown, allow_empty_topic_name }) => {
      try {
        const result = await zulipClient.getMessage(message_id, {
          apply_markdown,
          allow_empty_topic_name
        });
        
        return createSuccessResponse(JSON.stringify({
          message: {
            id: result.message.id,
            sender: result.message.sender_full_name,
            timestamp: new Date(result.message.timestamp * 1000).toISOString(),
            content: result.message.content,
            type: result.message.type,
            topic: result.message.topic || result.message.subject,
            stream_id: result.message.stream_id,
            reactions: result.message.reactions,
            edit_history: result.message.edit_history
          }
        }, null, 2));
      } catch (error) {
        return createErrorResponse(`Error getting message: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/server.ts:887-914 (registration)
    Registration of the 'get-message' tool using McpServer.tool(), including name, description, input schema, and handler.
      "get-message",
      "🔍 SINGLE MESSAGE: Get complete details about one specific message when you have its ID. Use this for in-depth analysis, checking edit history, reactions, or metadata. Returns single message with full details.",
      GetMessageSchema.shape,
      async ({ message_id, apply_markdown, allow_empty_topic_name }) => {
        try {
          const result = await zulipClient.getMessage(message_id, {
            apply_markdown,
            allow_empty_topic_name
          });
          
          return createSuccessResponse(JSON.stringify({
            message: {
              id: result.message.id,
              sender: result.message.sender_full_name,
              timestamp: new Date(result.message.timestamp * 1000).toISOString(),
              content: result.message.content,
              type: result.message.type,
              topic: result.message.topic || result.message.subject,
              stream_id: result.message.stream_id,
              reactions: result.message.reactions,
              edit_history: result.message.edit_history
            }
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error getting message: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • Zod schema defining input parameters for the 'get-message' tool: message_id (required), apply_markdown and allow_empty_topic_name (optional).
    export const GetMessageSchema = z.object({
      message_id: z.number().describe("Unique message ID to retrieve"),
      apply_markdown: z.boolean().optional().describe("Return HTML content (true) or raw Markdown (false). Default: true"),
      allow_empty_topic_name: z.boolean().optional().describe("Allow empty topic names in response (default: false)")
    });
  • ZulipClient.getMessage method that makes the actual API call to retrieve the message details from the Zulip server.
    async getMessage(messageId: number, params: {
      apply_markdown?: boolean;
      allow_empty_topic_name?: boolean;
    } = {}): Promise<{ message: ZulipMessage }> {
      debugLog('🔍 Debug - getMessage called with:', { messageId, ...params });
      
      const response = await this.client.get(`/messages/${messageId}`, { params });
      debugLog('✅ Debug - Message retrieved successfully:', response.data);
      return response.data;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns 'complete details' and 'full details,' which helps understand output richness. However, it doesn't mention behavioral aspects like error handling, permissions needed, or rate limits, leaving gaps for a read operation.

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 front-loaded with the core purpose ('Get complete details about one specific message') and efficiently adds context in two sentences. Every sentence earns its place by clarifying usage and output without redundancy.

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

Completeness4/5

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

For a read tool with no output schema, the description adequately covers purpose and usage. It hints at output richness ('complete details') but could be more explicit about return structure. Given the 100% schema coverage and clear purpose, it's mostly complete but lacks full behavioral disclosure.

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 fully documents all parameters. The description doesn't add any parameter-specific information beyond what's in the schema, such as explaining the impact of 'apply_markdown' on analysis. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the verb ('Get complete details') and resource ('one specific message') with specific scope ('when you have its ID'). It distinguishes from sibling tools like 'get-messages' (plural) by emphasizing retrieval of a single message for in-depth analysis.

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 explicitly states when to use this tool ('when you have its ID' and 'for in-depth analysis, checking edit history, reactions, or metadata'). However, it doesn't specify when NOT to use it or explicitly name alternatives like 'get-messages' for bulk retrieval.

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