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

whatsapp_get_chats

Retrieve all WhatsApp chat conversations from the WSAPI WhatsApp MCP Server to access message history and contact lists.

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. It fetches the list of chats from the WSAPI client and returns them with a count.
    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:53-79 (registration)
    The setupToolHandlers method registers all tools, including those from chatTools which contains the whatsapp_get_chats handler, by adding them to the tools Map.
    private setupToolHandlers(): void { logger.info('Setting up tool handlers'); // Register all tool categories 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}`); }); }); logger.info(`Registered ${this.tools.size} tools`); }
  • src/server.ts:18-18 (registration)
    Import of chatTools which provides the whatsapp_get_chats tool.
    import { chatTools } from './tools/chats.js';
  • Inline input schema for whatsapp_get_chats, which takes no parameters.
    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