get-message
Retrieve detailed information about a specific message in Zulip by its ID, including edit history, reactions, and metadata, for in-depth analysis and insights.
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
| Name | Required | Description | Default |
|---|---|---|---|
| allow_empty_topic_name | No | Allow empty topic names in response (default: false) | |
| apply_markdown | No | Return HTML content (true) or raw Markdown (false). Default: true | |
| message_id | Yes | Unique message ID to retrieve |
Implementation Reference
- src/server.ts:890-913 (handler)The main handler function that executes the get-message tool logic. It calls the ZulipClient to fetch the message by ID and formats the response with key details like sender, content, reactions, and edit history.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/types.ts:183-187 (schema)Zod schema defining the 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)") });
- src/server.ts:887-914 (registration)Registration of the 'get-message' tool in the MCP server using server.tool(), including name, description, schema reference, and inline handler function."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'}`); } } );