Skip to main content
Glama

get-message

Retrieve complete details of a Zulip message using its ID. Access edit history, reactions, and metadata for in-depth analysis.

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

  • The getMessage method on ZulipClient that makes the actual HTTP GET request to /messages/{messageId} to retrieve a single message by its ID.
    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;
    }
  • The MCP tool handler function for 'get-message'. It validates input via GetMessageSchema, calls zulipClient.getMessage(), and formats the response with message details like sender, timestamp, content, type, topic, stream_id, reactions, and edit_history.
    server.tool(
      "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'}`);
        }
      }
    );
  • The GetMessageSchema Zod schema defining input validation for the get-message tool: message_id (required number), apply_markdown (optional boolean), and allow_empty_topic_name (optional boolean).
    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)")
    });
  • src/server.ts:886-914 (registration)
    Registration of the 'get-message' tool with the MCP server via server.tool(). The tool name 'get-message' is registered with schema from GetMessageSchema.shape and the handler function.
    server.tool(
      "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'}`);
        }
      }
    );
  • The ZulipMessage interface which defines the shape of a message object returned from the Zulip API, including fields like id, content, reactions, edit_history etc.
    export interface ZulipMessage {
      id: number;
      sender_id: number;
      sender_full_name: string;
      sender_email: string;
      timestamp: number;
      content: string;
      content_type: string;
      stream_id?: number;
      subject?: string;
      topic?: string;
      type: "stream" | "private";
      recipient_id: number;
      reactions: ZulipReaction[];
      edit_history?: ZulipEditHistory[];
    }
Behavior3/5

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

No annotations provided; description implies read-only operation but does not explicitly state behavioral traits like no side effects or authorization requirements. Adequate but not thorough.

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?

Single sentence with emoji, front-loaded with purpose. Every word adds value, no fluff.

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?

Given the tool has 3 params, no output schema, and is a simple retrieval, the description adequately states it returns a single message with full details. Could mention return format but not strictly necessary.

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?

Input schema has 100% coverage with descriptions for all three parameters. Description adds no extra detail beyond schema, so baseline 3 is appropriate.

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?

Description clearly states it gets a single message by ID, with specific use cases like in-depth analysis, edit history, reactions. Distinguishes from sibling get-messages (plural) and others.

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?

Explicitly says 'when you have its ID' and lists use cases. Does not explicitly say when not to use, but context is clear there are alternatives for batch operations.

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