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: {},
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get total number of groups,' which implies a read-only operation, but doesn't mention any behavioral traits like whether it requires authentication, has rate limits, returns a simple integer or structured data, or if it's cached. This leaves significant gaps for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence: 'Get total number of groups.' It's front-loaded with the core action and resource, with zero wasted words. This is optimally concise for a simple tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks context. It doesn't explain what 'groups' refer to (e.g., WhatsApp groups), the return format (e.g., integer count), or any prerequisites. For a tool with no structured fields to rely on, more completeness would be beneficial, though it's not entirely misleading.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing on the tool's purpose. A baseline of 4 is applied since the schema fully covers the absence of parameters, and the description doesn't add unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get total number of groups' clearly states the verb ('Get') and resource ('total number of groups'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'waha_get_groups' (which likely lists groups with details) or 'waha_get_group_info' (which gets info about a specific group), missing full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't specify if this is for quick counting versus detailed listing with 'waha_get_groups', or if it's preferred for performance reasons. Without such context, users must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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-whatsapp-mcp'

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