list_contacts
Retrieve all WhatsApp Business contacts for a specified instance to manage messaging and communication workflows.
Instructions
List all contacts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceName | Yes | Instance name |
Implementation Reference
- src/index.ts:857-867 (handler)The main handler function for the 'list_contacts' tool. It fetches contacts from the EvolutionAPI service for the given instance and returns them as a JSON-formatted text content block.private async handleListContacts(args: any) { const contacts = await evolutionAPI.findContacts(args.instanceName); return { content: [ { type: 'text', text: JSON.stringify(contacts, null, 2) } ] }; }
- src/index.ts:307-317 (schema)Defines the tool schema for 'list_contacts', specifying the input schema that requires an 'instanceName' parameter.{ name: 'list_contacts', description: 'List all contacts', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name' } }, required: ['instanceName'] } },
- src/index.ts:524-525 (registration)Registers the 'list_contacts' tool in the switch statement within the CallToolRequest handler, dispatching to the specific handler method.case 'list_contacts': return await this.handleListContacts(args);