Skip to main content
Glama
wsapi-chat
by wsapi-chat

whatsapp_get_chats

Retrieve a complete list of all WhatsApp conversations to access chat history and manage messaging interactions through the WSAPI WhatsApp MCP Server.

Instructions

Get list of all WhatsApp chats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'whatsapp_get_chats' tool, which fetches and returns the list of all WhatsApp chats using the wsapiClient.
    export const getChats: ToolHandler = { name: 'whatsapp_get_chats', description: 'Get list of all WhatsApp chats.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Getting chats list'); const result = await wsapiClient.get('/chats'); return { success: true, chats: result, count: result.length }; }, };
  • Input schema definition for the 'whatsapp_get_chats' tool (empty object, no parameters required).
    export const getChats: ToolHandler = { name: 'whatsapp_get_chats', description: 'Get list of all WhatsApp chats.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Getting chats list'); const result = await wsapiClient.get('/chats'); return { success: true, chats: result, count: result.length }; }, };
  • src/server.ts:57-76 (registration)
    Tool registration logic in setupToolHandlers method, where chatTools (containing whatsapp_get_chats) is added to the tools Map.
    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}`); }); });
  • Grouping export of chat-related tools including getChats (whatsapp_get_chats) for registration in server.
    export const chatTools = { getChats, getChat, setChatPresence, archiveChat, pinChat };

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