Skip to main content
Glama

waha_check_contact_exists

Verify if a phone number is registered on WhatsApp to ensure valid contacts before messaging. Input a phone number to check its WhatsApp availability.

Instructions

Check if phone number is registered on WhatsApp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phoneYesPhone number to check (e.g., '1234567890')

Implementation Reference

  • src/index.ts:912-923 (registration)
    Tool registration in the listTools handler, defining the tool name, description, and input schema.
    name: "waha_check_contact_exists",
    description: "Check if phone number is registered on WhatsApp.",
    inputSchema: {
      type: "object",
      properties: {
        phone: {
          type: "string",
          description: "Phone number to check (e.g., '1234567890')",
        },
      },
      required: ["phone"],
    },
  • The MCP tool handler function that validates input, calls the WAHA client method, and returns a formatted text response with the result.
    private async handleCheckContactExists(args: any) {
      const phone = args.phone;
    
      if (!phone) {
        throw new Error("phone is required");
      }
    
      const result = await this.wahaClient.checkContactExists(phone);
    
      return {
        content: [
          {
            type: "text",
            text: `Contact existence check for ${phone}:\n${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying the required 'phone' parameter as a string.
    inputSchema: {
      type: "object",
      properties: {
        phone: {
          type: "string",
          description: "Phone number to check (e.g., '1234567890')",
        },
      },
      required: ["phone"],
  • src/index.ts:1137-1138 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement.
    case "waha_check_contact_exists":
      return await this.handleCheckContactExists(args);
  • WAHA client helper method that makes a GET request to the WAHA API endpoint /api/contacts/check-exists to check if the phone number exists.
    async checkContactExists(phone: string): Promise<any> {
      if (!phone) {
        throw new WAHAError("phone is required");
      }
    
      const queryParams = { 
        phone,
        session: this.session
      };
      const queryString = this.buildQueryString(queryParams);
      const endpoint = `/api/contacts/check-exists${queryString}`;
    
      return this.request<any>(endpoint, {
        method: "GET",
      });
    }
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 the tool checks registration status but doesn't reveal critical traits: whether it's a read-only operation, potential rate limits, authentication requirements, error handling (e.g., for invalid numbers), or what the output looks like (e.g., boolean or detailed response). This is a significant gap for a tool with no annotation coverage.

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, efficient sentence that directly states the tool's function without any fluff. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain the return value (e.g., true/false or error messages), behavioral aspects like safety or performance, or usage context. Given the complexity of checking WhatsApp registration, more detail is needed to guide the agent effectively.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'phone' parameter clearly documented. The description adds no additional parameter details beyond the schema, such as format constraints (e.g., international prefix) or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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 clearly states the tool's purpose: 'Check if phone number is registered on WhatsApp.' It specifies the verb ('check') and resource ('phone number'), making the function unambiguous. However, it doesn't explicitly differentiate from siblings like 'waha_get_contact' or 'waha_get_all_contacts', which might also involve contact verification, so it doesn't reach the highest score.

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. It doesn't mention prerequisites (e.g., needing a WhatsApp account), exclusions, or compare it to sibling tools like 'waha_get_contact' for more detailed contact info. This lack of context leaves the agent to infer usage scenarios.

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