Skip to main content
Glama
by wsapi-chat

whatsapp_send_reaction

Send an emoji reaction to a specific WhatsApp message by providing the message ID, chat ID, sender ID, and desired emoji. This allows users to express quick responses to messages in WhatsApp conversations.

Instructions

Send a reaction (emoji) to a specific message.

Input Schema

NameRequiredDescriptionDefault
messageIdYesID of the message to react to
reactionYesEmoji reaction to send (max 10 characters)
senderIdYesID of the original message sender
toYesChat ID where the message is located

Input Schema (JSON Schema)

{ "properties": { "messageId": { "description": "ID of the message to react to", "type": "string" }, "reaction": { "description": "Emoji reaction to send (max 10 characters)", "type": "string" }, "senderId": { "description": "ID of the original message sender", "type": "string" }, "to": { "description": "Chat ID where the message is located", "type": "string" } }, "required": [ "messageId", "to", "senderId", "reaction" ], "type": "object" }

Implementation Reference

  • The ToolHandler implementation for 'whatsapp_send_reaction', defining the tool metadata, input schema (embedded), and async handler that validates input and sends the reaction via WSAPI.
    export const sendReactionMessage: ToolHandler = { name: 'whatsapp_send_reaction', description: 'Send a reaction (emoji) to a specific message.', inputSchema: { type: 'object', properties: { messageId: { type: 'string', description: 'ID of the message to react to', }, to: { type: 'string', description: 'Chat ID where the message is located', }, senderId: { type: 'string', description: 'ID of the original message sender', }, reaction: { type: 'string', description: 'Emoji reaction to send (max 10 characters)', }, }, required: ['messageId', 'to', 'senderId', 'reaction'], }, handler: async (args: any) => { const input = validateInput(sendReactionMessageSchema, args) as SendReactionMessageInput; logger.info('Sending reaction', { messageId: input.messageId, to: input.to, reaction: input.reaction, }); const result = await wsapiClient.post(`/messages/${input.messageId}/reaction`, { to: input.to, senderId: input.senderId, reaction: input.reaction, }); logger.info('Reaction sent successfully', { messageId: result.id }); return { success: true, messageId: result.id, message: 'Reaction sent successfully', }; }, };
  • Zod schema used for validating input to the whatsapp_send_reaction tool handler.
    export const sendReactionMessageSchema = z.object({ messageId: messageIdSchema, to: chatIdSchema, senderId: phoneNumberSchema, reaction: z.string().min(1).max(10), // Emoji });
  • src/server.ts:53-79 (registration)
    Registration logic in the MCP server that imports and registers all tools from messagingTools (which includes whatsapp_send_reaction) into the tool map.
    private setupToolHandlers(): void { logger.info('Setting up tool handlers'); // Register all tool categories const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ]; toolCategories.forEach(category => { Object.values(category).forEach(tool => { if (this.tools.has(tool.name)) { logger.warn(`Tool ${tool.name} already registered, skipping`); return; } this.tools.set(tool.name, tool); logger.debug(`Registered tool: ${tool.name}`); }); }); logger.info(`Registered ${this.tools.size} tools`); }
  • src/server.ts:15-16 (registration)
    Import of messagingTools which contains the whatsapp_send_reaction handler.
    import { messagingTools } from './tools/messaging.js'; import { contactTools } from './tools/contacts.js';
  • Export of messagingTools object that bundles the sendReactionMessage handler for registration in the server.
    export const messagingTools = { sendTextMessage, sendImageMessage, sendVideoMessage, sendLinkMessage, sendReactionMessage, editMessage, deleteMessage, markMessageAsRead, starMessage, ...advancedMessagingTools, };

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/wsapi-chat/wsapi-mcp'

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