Skip to main content
Glama

waha_send_contact

Send contact cards to WhatsApp chats using vCard format. Share contact information by specifying chat ID and vCard data, with optional message reply functionality.

Instructions

Send contact card(s) to a WhatsApp chat using vCard format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)
vcardYesvCard formatted contact data (e.g., 'BEGIN:VCARD\nVERSION:3.0\nFN:Jane Doe\nTEL:+1234567890\nEND:VCARD')
replyToNoOptional message ID to reply to

Implementation Reference

  • The main handler function that executes the waha_send_contact tool logic, validating inputs, calling WAHAClient.sendContact, formatting response with formatSendMessageSuccess
    private async handleSendContact(args: any) {
      const chatId = args.chatId;
      const vcard = args.vcard;
      const replyTo = args.replyTo;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      if (!vcard) {
        throw new Error("vcard is required");
      }
    
      const response = await this.wahaClient.sendContact({
        chatId,
        contacts: [{ vcard }],
        reply_to: replyTo,
      });
    
      const formattedResponse = formatSendMessageSuccess(
        chatId,
        response.id,
        response.timestamp
      );
    
      return {
        content: [
          {
            type: "text",
            text: `${formattedResponse}\nContact card sent successfully.`,
          },
        ],
      };
    }
  • Input schema definition and description for the waha_send_contact tool, registered in ListToolsRequestSchema handler
      name: "waha_send_contact",
      description: "Send contact card(s) to a WhatsApp chat using vCard format.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
          vcard: {
            type: "string",
            description: "vCard formatted contact data (e.g., 'BEGIN:VCARD\\nVERSION:3.0\\nFN:Jane Doe\\nTEL:+1234567890\\nEND:VCARD')",
          },
          replyTo: {
            type: "string",
            description: "Optional message ID to reply to",
          },
        },
        required: ["chatId", "vcard"],
      },
    },
  • src/index.ts:1085-1086 (registration)
    Tool dispatch/registration in the CallToolRequestSchema switch statement
    case "waha_send_contact":
      return await this.handleSendContact(args);
  • Underlying WAHAClient method that makes the HTTP POST request to /api/sendContactVcard to send the contact vCard
    async sendContact(params: {
      chatId: string;
      contacts: Array<{ vcard: string }>;
      reply_to?: string;
    }): Promise<SendMessageResponse> {
      const { chatId, contacts, reply_to } = params;
    
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      if (!contacts || contacts.length === 0) {
        throw new WAHAError("contacts array is required");
      }
    
      const body = {
        chatId,
        contacts,
        session: this.session,
        reply_to,
      };
    
      return this.request<SendMessageResponse>("/api/sendContactVcard", {
        method: "POST",
        body: JSON.stringify(body),
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It states the action is a 'send' operation (implying mutation) but doesn't disclose permissions needed, rate limits, whether it's idempotent, error conditions, or what happens on success/failure. This is inadequate for a mutation tool with zero 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 with zero wasted words. It's front-loaded with the core action and includes all essential elements (what, where, how). Every word earns its place.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after sending (e.g., returns message ID, success status), error handling, or behavioral constraints. The 100% schema coverage helps, but the overall context for safe/effective use is lacking.

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?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no parameter-specific information beyond what's in the schema (e.g., no examples beyond the basic vCard mention, no clarification on chatId formats beyond '@c.us'). Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Send contact card(s)'), resource ('to a WhatsApp chat'), and format ('using vCard format'). It distinguishes this tool from siblings like waha_send_message or waha_send_media by specifying the unique contact-sharing functionality.

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., chat must exist), exclusions, or compare it to similar tools like waha_send_message for text or waha_send_media for files.

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