get-message-read-receipts
Retrieve a list of users who have read a specific message by providing its unique ID.
Instructions
Get list of users who have read a specific message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | Unique message ID to get read receipts for |
Implementation Reference
- src/server.ts:621-636 (handler)The MCP server tool handler for 'get-message-read-receipts'. Calls zulipClient.getMessageReadReceipts(message_id) and returns a JSON response with message_id, read_by_count, and user_ids.
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/types.ts:216-218 (schema)Zod schema defining the input for get-message-read-receipts: requires a message_id (number).
export const GetMessageReadReceiptsSchema = z.object({ message_id: z.number().describe("Unique message ID to get read receipts for") }); - src/types.ts:267-267 (schema)TypeScript type inferred from GetMessageReadReceiptsSchema.
export type GetMessageReadReceiptsParams = z.infer<typeof GetMessageReadReceiptsSchema>; - src/zulip/client.ts:227-230 (helper)ZulipClient method that makes the actual API call to GET /messages/{messageId}/read_receipts and returns the response data.
async getMessageReadReceipts(messageId: number): Promise<{ user_ids: number[] }> { const response = await this.client.get(`/messages/${messageId}/read_receipts`); return response.data; } - src/server.ts:621-637 (registration)Tool registered with the MCP server using server.tool() with name 'get-message-read-receipts'.
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'}`); } } );