Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

send_buttons

Send interactive WhatsApp messages with customizable buttons to recipients, enabling quick responses for business communications and customer engagement.

Instructions

Send message with buttons

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buttonsYesArray of buttons
descriptionNoMessage description
footerNoMessage footer
instanceNameYesInstance name
numberYesRecipient phone number
titleNoMessage title

Implementation Reference

  • src/index.ts:133-158 (registration)
    Registration of the 'send_buttons' tool in the tools array, including name, description, and input schema definition.
    { name: 'send_buttons', description: 'Send message with buttons', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name' }, number: { type: 'string', description: 'Recipient phone number' }, title: { type: 'string', description: 'Message title' }, description: { type: 'string', description: 'Message description' }, footer: { type: 'string', description: 'Message footer' }, buttons: { type: 'array', items: { type: 'object', properties: { buttonId: { type: 'string' }, displayText: { type: 'string' } } }, description: 'Array of buttons' } }, required: ['instanceName', 'number', 'buttons'] } },
  • The primary handler function for the 'send_buttons' tool. It transforms the input buttons format, calls the EvolutionAPI sendButtons method, and formats the response as MCP content.
    private async handleSendButtons(args: any) { const buttons = args.buttons.map((btn: any) => ({ buttonId: btn.buttonId, buttonText: { displayText: btn.displayText } })); const result = await evolutionAPI.sendButtons(args.instanceName, { number: args.number, title: args.title, description: args.description, footer: args.footer, buttons }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Helper method in EvolutionAPI service that performs the actual HTTP POST request to the Evolution API endpoint /message/sendButtons/{instanceName} to send buttons message.
    async sendButtons(instanceName: string, data: { number: string; title?: string; description?: string; footer?: string; buttons: Array<{ buttonId: string; buttonText: { displayText: string }; }>; }): Promise<Message> { const response = await this.client.post(`/message/sendButtons/${instanceName}`, data); return response.data; }

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/luiso2/mcp-evolution-api'

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