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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:2411-2422 (handler)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);
- src/client/waha-client.ts:1216-1222 (helper)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", }); }
- src/index.ts:865-868 (schema)Input schema definition for the tool, specifying an empty object (no input parameters required).inputSchema: { type: "object", properties: {}, },