remove-emoji-reaction
Remove an emoji reaction from a Zulip message by specifying the message ID and emoji name.
Instructions
Remove an emoji reaction from a message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ID of the message to remove reaction from | |
| emoji_name | Yes | Emoji name to remove (e.g., 'thumbs_up', 'heart') | |
| emoji_code | No | Unicode code point for the emoji | |
| reaction_type | No | Type of emoji reaction |
Implementation Reference
- src/server.ts:916-932 (handler)The tool handler for 'remove-emoji-reaction'. Registers the tool with the MCP server, calls zulipClient.removeReaction() with message_id, emoji_name, emoji_code, and reaction_type, and returns a success or error response.
server.tool( "remove-emoji-reaction", "Remove an emoji reaction from a message.", RemoveReactionSchema.shape, async ({ message_id, emoji_name, emoji_code, reaction_type }) => { try { await zulipClient.removeReaction(message_id, { emoji_name, emoji_code, reaction_type }); return createSuccessResponse(`Reaction ${emoji_name} removed from message ${message_id}!`); } catch (error) { return createErrorResponse(`Error removing reaction: ${error instanceof Error ? error.message : 'Unknown error'}`); } } ); - src/zulip/client.ts:214-225 (helper)The ZulipClient.removeReaction() method that sends a DELETE request to /messages/{messageId}/reactions with query parameters emoji_name, emoji_code, and reaction_type.
async removeReaction(messageId: number, params: { emoji_name: string; emoji_code?: string; reaction_type?: string; }): Promise<void> { const queryParams = new URLSearchParams(); queryParams.append('emoji_name', params.emoji_name); if (params.emoji_code) {queryParams.append('emoji_code', params.emoji_code);} if (params.reaction_type) {queryParams.append('reaction_type', params.reaction_type);} await this.client.delete(`/messages/${messageId}/reactions?${queryParams.toString()}`); } - src/types.ts:205-210 (schema)The RemoveReactionSchema Zod schema defining the input parameters: message_id (number), emoji_name (string), emoji_code (optional string), reaction_type (optional enum of unicode_emoji, realm_emoji, zulip_extra_emoji).
export const RemoveReactionSchema = z.object({ message_id: z.number().describe("ID of the message to remove reaction from"), emoji_name: z.string().describe("Emoji name to remove (e.g., 'thumbs_up', 'heart')"), emoji_code: z.string().optional().describe("Unicode code point for the emoji"), reaction_type: z.enum(["unicode_emoji", "realm_emoji", "zulip_extra_emoji"]).optional().describe("Type of emoji reaction") }); - src/types.ts:265-265 (schema)TypeScript type RemoveReactionParams inferred from RemoveReactionSchema.
export type RemoveReactionParams = z.infer<typeof RemoveReactionSchema>; - src/server.ts:916-932 (registration)The tool is registered via server.tool('remove-emoji-reaction', ...) with the schema and handler function.
server.tool( "remove-emoji-reaction", "Remove an emoji reaction from a message.", RemoveReactionSchema.shape, async ({ message_id, emoji_name, emoji_code, reaction_type }) => { try { await zulipClient.removeReaction(message_id, { emoji_name, emoji_code, reaction_type }); return createSuccessResponse(`Reaction ${emoji_name} removed from message ${message_id}!`); } catch (error) { return createErrorResponse(`Error removing reaction: ${error instanceof Error ? error.message : 'Unknown error'}`); } } );