Skip to main content
Glama
by wsapi-chat

whatsapp_get_groups

Retrieve a complete list of all WhatsApp groups from your account to manage group communications and access group information.

Instructions

Get list of all WhatsApp groups.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • The primary implementation of the 'whatsapp_get_groups' tool as a ToolHandler, including description, empty input schema, and async handler that fetches groups from wsapiClient.get('/groups') and returns them with count.
    export const getGroups: ToolHandler = { name: 'whatsapp_get_groups', description: 'Get list of all WhatsApp groups.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Getting groups list'); const result = await wsapiClient.get('/groups'); return { success: true, groups: result, count: result.length }; }, };
  • src/server.ts:53-79 (registration)
    The setupToolHandlers method registers all tools from imported categories (including groupTools containing whatsapp_get_groups) into the server's tools Map by name.
    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:17-17 (registration)
    Import of groupTools from groups.ts, which bundles the whatsapp_get_groups handler for server registration.
    import { groupTools } from './tools/groups.js';
  • Bundles the getGroups (whatsapp_get_groups) handler with other group tools for collective import and registration in the server.
    export const groupTools = { getGroups, createGroup, getGroup, updateGroupName };

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