Skip to main content
Glama

waha_get_contact

Retrieve WhatsApp contact details by ID to access user information for messaging and chat management.

Instructions

Get contact information by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesContact ID (format: number@c.us)

Implementation Reference

  • The main handler function for the "waha_get_contact" MCP tool. It validates the contactId input, calls the WAHA client's getContact method, and returns a formatted text response containing the contact information as JSON.
    private async handleGetContact(args: any) {
      const contactId = args.contactId;
    
      if (!contactId) {
        throw new Error("contactId is required");
      }
    
      const contact = await this.wahaClient.getContact(contactId);
    
      return {
        content: [
          {
            type: "text",
            text: `Contact information for ${contactId}:\n${JSON.stringify(contact, null, 2)}`,
          },
        ],
      };
    }
  • The input schema definition for the "waha_get_contact" tool, specifying that a 'contactId' string (format: number@c.us) is required.
    {
      name: "waha_get_contact",
      description: "Get contact information by ID.",
      inputSchema: {
        type: "object",
        properties: {
          contactId: {
            type: "string",
            description: "Contact ID (format: number@c.us)",
          },
        },
        required: ["contactId"],
      },
    },
  • src/index.ts:1134-1135 (registration)
    Registration of the tool handler in the MCP CallToolRequestSchema switch statement, dispatching calls to handleGetContact.
      return await this.handleGetContact(args);
    case "waha_get_all_contacts":
  • Supporting WAHA client method that performs the actual API request to retrieve contact information via GET /api/contacts?contactId=...&session=...
    async getContact(contactId: string): Promise<any> {
      if (!contactId) {
        throw new WAHAError("contactId is required");
      }
    
      const queryParams = { 
        contactId,
        session: this.session
      };
      const queryString = this.buildQueryString(queryParams);
      const endpoint = `/api/contacts${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 full burden. It states 'Get contact information' but doesn't disclose behavioral traits such as required permissions, rate limits, error handling (e.g., for invalid IDs), or what 'contact information' includes (e.g., name, phone). For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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: 'Get contact information by ID.' It is front-loaded with the core action and resource, with zero wasted words. Every part earns its place, making it highly concise and well-structured.

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 low complexity (single parameter, read-only operation) and 100% schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it lacks details on return values (what 'contact information' entails) and behavioral context. For a basic retrieval tool, it meets the bare minimum but leaves room for improvement in completeness.

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 'contactId' documented as 'Contact ID (format: number@c.us)'. The description adds no additional meaning beyond this, as it only repeats 'by ID' without elaborating on format or constraints. With high schema coverage, the baseline is 3, and the description doesn't compensate further.

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 contact information by ID' clearly states the verb 'Get' and resource 'contact information', specifying retrieval by ID. It distinguishes from siblings like 'waha_get_all_contacts' (which lists all contacts) and 'waha_check_contact_exists' (which verifies existence without returning details), though it doesn't explicitly mention these distinctions. The purpose is specific but lacks explicit sibling differentiation.

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 valid contact ID), exclusions (e.g., not for bulk retrieval), or direct comparisons to siblings like 'waha_get_all_contacts' or 'waha_check_contact_exists'. Usage is implied by the name and description alone, with no explicit context.

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