Skip to main content
Glama

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
NameRequiredDescriptionDefault
messageIdYesMessage ID to react to
reactionYesEmoji to react with (e.g., 'πŸ‘', '❀️', 'πŸ˜‚'). Use empty string to remove reaction.

Implementation Reference

  • 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}.`,
          },
        ],
      };
    }
  • 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);
  • 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),
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seejux/waha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server