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),
      });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it can add reactions and remove them by sending an empty string. However, it doesn't mention permissions needed, rate limits, or what happens if the message doesn't exist. For a mutation tool, this leaves gaps in understanding potential side effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste: the first states the primary action, and the second adds crucial removal functionality. It's front-loaded with the main purpose and efficiently covers both use cases without redundancy, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple mutation tool with 2 parameters, the description is adequate but incomplete. It covers the basic action and parameter nuance but lacks details on error handling, return values, or system constraints. For a tool that modifies data, more context on behavior would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by clarifying the 'reaction' parameter's special case (empty string removes reaction), which isn't obvious from the schema alone. This extra semantic detail compensates slightly, but it doesn't explain format beyond examples like '👍', so it's not a full 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Add an emoji reaction to a message') and distinguishes it from siblings by mentioning removal functionality. It uses precise verbs ('Add', 'remove') and identifies the resource ('message'), making its purpose unambiguous compared to other messaging tools like waha_send_message or waha_edit_message.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool (to add or remove reactions) but doesn't explicitly mention when not to use it or name alternatives. It implies usage for reaction management without comparing to other tools like waha_star_message, which might serve different purposes. This is helpful but lacks explicit exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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-whatsapp-mcp'

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