Skip to main content
Glama
by wsapi-chat

whatsapp_get_contacts

Retrieve a complete list of all WhatsApp contacts from the connected account to enable contact lookup and management operations.

Instructions

Get list of all WhatsApp contacts.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The complete ToolHandler implementation for 'whatsapp_get_contacts', which fetches the list of all WhatsApp contacts using wsapiClient.get('/contacts') and returns them with metadata.
    export const getContacts: ToolHandler = { name: 'whatsapp_get_contacts', description: 'Get list of all WhatsApp contacts.', inputSchema: { type: 'object', properties: {}, }, handler: async () => { logger.info('Getting contacts list'); const result = await wsapiClient.get('/contacts'); logger.info('Retrieved contacts successfully', { count: result.length }); return { success: true, contacts: result, count: result.length, message: `Retrieved ${result.length} contacts`, }; }, };
  • src/server.ts:57-76 (registration)
    Registers all tools dynamically by iterating over tool category objects, including 'contactTools' which exports the 'whatsapp_get_contacts' handler.
    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}`); }); });
  • Input schema for 'whatsapp_get_contacts' tool, which takes no parameters (empty object).
    inputSchema: { type: 'object', properties: {}, },

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