Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

check_number

Verify phone numbers to determine WhatsApp account status for business messaging, ensuring messages reach valid contacts.

Instructions

Check if phone numbers have WhatsApp

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceNameYesInstance name
numbersYesPhone numbers to check

Implementation Reference

  • The primary MCP tool handler for 'check_number'. It calls the EvolutionAPI service to check WhatsApp status for given phone numbers and returns the result as formatted JSON text.
    private async handleCheckNumber(args: any) { const result = await evolutionAPI.checkNumberStatus(args.instanceName, args.numbers); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Tool definition including name, description, and input schema for validation.
    { name: 'check_number', description: 'Check if phone numbers have WhatsApp', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name' }, numbers: { type: 'array', items: { type: 'string' }, description: 'Phone numbers to check' } }, required: ['instanceName', 'numbers'] } },
  • src/index.ts:526-527 (registration)
    Registration of the tool handler in the MCP call tool request switch statement.
    case 'check_number': return await this.handleCheckNumber(args);
  • Supporting method in EvolutionAPI service that makes the actual HTTP POST request to the backend API endpoint /chat/checkNumberStatus/{instanceName} to check number statuses.
    async checkNumberStatus(instanceName: string, numbers: string[]): Promise<any[]> { const response = await this.client.post(`/chat/checkNumberStatus/${instanceName}`, { numbers }); return response.data; }
  • HTTP API route handler for checking numbers (POST /check-numbers), which cleans numbers and calls the same EvolutionAPI method. Related but separate from MCP tool.
    router.post('/check-numbers', async (req, res) => { try { const { instanceName, numbers } = req.body; if (!instanceName || !numbers || !Array.isArray(numbers)) { res.status(400).json({ error: 'Missing required fields: instanceName, numbers (array)' }); return; } const cleanNumbers = numbers.map(n => n.replace(/[\s\-\+\(\)]/g, '')); const result = await evolutionAPI.checkNumberStatus(instanceName, cleanNumbers); res.json(result); } catch (error: any) { res.status(500).json({ error: error.message }); } });

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