get-message-read-receipts
Retrieve a list of users who have read a specific message in Zulip by providing the message ID, enabling tracking of message engagement and audience reach.
Instructions
Get list of users who have read a specific message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | Unique message ID to get read receipts for |
Implementation Reference
- src/server.ts:625-636 (handler)MCP tool handler function that calls the Zulip client to fetch read receipts for a message and formats the response.async ({ message_id }) => { try { const result = await zulipClient.getMessageReadReceipts(message_id); return createSuccessResponse(JSON.stringify({ message_id, read_by_count: result.user_ids.length, user_ids: result.user_ids }, null, 2)); } catch (error) { return createErrorResponse(`Error getting read receipts: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/types.ts:216-218 (schema)Zod schema defining the input parameters for the tool (message_id: number).export const GetMessageReadReceiptsSchema = z.object({ message_id: z.number().describe("Unique message ID to get read receipts for") });
- src/server.ts:621-637 (registration)Registration of the MCP tool using McpServer.tool(), including name, description, input schema, and handler function.server.tool( "get-message-read-receipts", "Get list of users who have read a specific message.", GetMessageReadReceiptsSchema.shape, async ({ message_id }) => { try { const result = await zulipClient.getMessageReadReceipts(message_id); return createSuccessResponse(JSON.stringify({ message_id, read_by_count: result.user_ids.length, user_ids: result.user_ids }, null, 2)); } catch (error) { return createErrorResponse(`Error getting read receipts: ${error instanceof Error ? error.message : 'Unknown error'}`); } } );
- src/zulip/client.ts:227-230 (helper)ZulipClient method that performs the actual API call to retrieve read receipts for a message.async getMessageReadReceipts(messageId: number): Promise<{ user_ids: number[] }> { const response = await this.client.get(`/messages/${messageId}/read_receipts`); return response.data; }