waha_react_to_message
Add or remove emoji reactions to WhatsApp messages using the WAHA MCP Server. Specify message ID and emoji to manage reactions in chats.
Instructions
Add an emoji reaction to a message. To remove a reaction, send an empty string.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messageId | Yes | Message ID to react to | |
| reaction | Yes | Emoji to react with (e.g., '👍', '❤️', '😂'). Use empty string to remove reaction. |
Implementation Reference
- src/index.ts:1802-1829 (handler)MCP tool handler function that extracts parameters, validates them, calls the WAHAClient.reactToMessage method, and formats the success response.private async handleReactToMessage(args: any) { const messageId = args.messageId; const reaction = args.reaction; if (!messageId) { throw new Error("messageId is required"); } if (reaction === undefined) { throw new Error("reaction is required"); } await this.wahaClient.reactToMessage({ messageId, reaction, }); return { content: [ { type: "text", text: reaction === "" ? `Successfully removed reaction from message ${messageId}.` : `Successfully reacted to message ${messageId} with ${reaction}.`, }, ], }; }
- src/index.ts:476-492 (schema)Input schema definition for the waha_react_to_message tool, defining parameters messageId and reaction.name: "waha_react_to_message", description: "Add an emoji reaction to a message. To remove a reaction, send an empty string.", inputSchema: { type: "object", properties: { messageId: { type: "string", description: "Message ID to react to", }, reaction: { type: "string", description: "Emoji to react with (e.g., '👍', '❤️', '😂'). Use empty string to remove reaction.", }, }, required: ["messageId", "reaction"], }, },
- src/index.ts:1087-1088 (registration)Tool registration in the MCP CallToolRequestSchema switch statement, dispatching to the handler.case "waha_react_to_message": return await this.handleReactToMessage(args);
- src/client/waha-client.ts:685-709 (helper)WAHAClient helper method that performs the actual HTTP PUT request to the WAHA API /api/reaction endpoint to add/remove reaction.async reactToMessage(params: { messageId: string; reaction: string; }): Promise<void> { const { messageId, reaction } = params; if (!messageId) { throw new WAHAError("messageId is required"); } if (!reaction) { throw new WAHAError("reaction is required"); } const body = { messageId, reaction, session: this.session, }; await this.request<void>("/api/reaction", { method: "PUT", body: JSON.stringify(body), }); }