Skip to main content
Glama

waha_get_groups_count

Retrieve the total number of WhatsApp groups to monitor group activity and manage chat organization.

Instructions

Get total number of groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'waha_get_groups_count' MCP tool. It invokes the WAHA client's getGroupsCount method and returns a formatted text response with the total number of groups.
    private async handleGetGroupsCount(args: any) { const result = await this.wahaClient.getGroupsCount(); return { content: [ { type: "text", text: `Total number of groups: ${result.count}`, }, ], }; }
  • src/index.ts:863-869 (registration)
    Tool registration entry in the ListToolsRequestSchema handler, defining the tool name, description, and empty input schema (no parameters required).
    name: "waha_get_groups_count", description: "Get total number of groups.", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:1132-1132 (registration)
    Tool handler dispatch in the CallToolRequestSchema switch statement, routing calls to the specific handleGetGroupsCount function.
    return await this.handleGetGroupsCount(args);
  • Supporting client method in WAHAClient that performs the HTTP GET request to the WAHA API endpoint /api/{session}/groups/count to fetch the groups count.
    async getGroupsCount(): Promise<{ count: number }> { const endpoint = `/api/${this.session}/groups/count`; return this.request<{ count: number }>(endpoint, { method: "GET", }); }
  • Input schema definition for the tool, specifying an empty object (no input parameters required).
    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/seejux/waha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server