Skip to main content
Glama

send_whatsapp

Destructive

REAL ACTION: sends a WhatsApp message to a lead, a contact or a bare number, and records it on that record's timeline. Recipient: exactly one of lead_id, contact_id or to_number (E.164, no record needed - it is matched like find_by_phone, incl. contact mobiles; with no unique match the entry is kept as 'unassigned'). Consent, legal basis and purpose are checked for leads AND contacts. Beeper: the chat is the one linked to the record, otherwise the WhatsApp chat of the number - found or started on the bridge (startWhatsappChat; starting sends nothing) and only used if a participant really has that number. dry_run:true resolves everything (recipient, consent, route, chat) and sends NOTHING. Which way it goes out is the tenant's setting (tenants.whatsapp_provider): 'beeper' sends through the local bridge from a personal account, 'twilio' sends through the connected AI-Call-Bot from one of its numbers, and 'twilio_direct' sends WhatsApp Business straight from the tenant's OWN Twilio account and approved sender. The timeline entry is the same either way. Required: body and one recipient. Optional: to_number next to a record = send to that number instead, chat_id (beeper, defaults to the linked WhatsApp channel), phone_number_id (twilio, the bot number to send FROM — required when the bot owns more than one). If sending fails, it is NOT retried, and the timeline says the message MAY have gone out anyway — check the chat before trying again rather than sending twice. ATTACHMENT (twilio_direct only): document_id (a stored CallPilotAI document, sent via a short-lived signed link) or media_url (a public https file, e.g. a PDF). body becomes the caption and may then be empty. Never pass file contents.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "send_whatsapp"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNoMessage text.
chat_idNoBeeper path: the Beeper chatID. Defaults to the WhatsApp channel linked to the lead.
dry_runNoOnly resolve recipient, consent, route and chat - send nothing, create nothing.
lead_idNoRecipient: a lead. Exactly one of lead_id, contact_id, to_number.
purposeNoThe processing purpose of this message (e.g. akquise, terminabstimmung). A consent is always for ONE purpose; without one, only the record's state and any withdrawal are checked. Refused outright if the tenant has switched on legal_basis_enforced.
media_urlNotwilio_direct: attach the file at this public https address (PDF, image). Use exactly one of document_id or media_url.
to_numberNoRecipient without a record (E.164, e.g. +491701234567), matched via find_by_phone. Next to lead_id/contact_id: send to this number instead of the stored one.
contact_idNoRecipient: a contact (person). Number: mobile, then phone.
content_sidNotwilio_direct path: a Meta-approved template (Twilio ContentSid). Required OUTSIDE the 24-hour window, where free text is refused — send this instead of body.
document_idNotwilio_direct: attach this stored document (documents.id). Use exactly one of document_id or media_url.
human_approvedNoEU AI Act Art. 50: true ONLY if a human has read and approved this exact text before sending. Otherwise the line 'Diese Nachricht wurde mit KI erstellt. / This message was created with AI.' is appended to body.
phone_number_idNoTwilio path: which of the bot's numbers to send from.
content_variablesNotwilio_direct path: the template's variables, e.g. {"1": "Frau Muster"}. Only with content_sid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / human_approved
      Added value: +{
      +  "description": "EU AI Act Art. 50: true ONLY if a human has read and approved this exact text before sending. Otherwise the line 'Diese Nachricht wurde mit KI erstellt. / This message was created with AI.' is appended to body.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: consent/legal-basis/purpose checks for both leads and contacts, no retry on failure with a timeline warning that the message MAY have gone out, dry_run creating nothing, the AI-disclaimer append when human_approved is false, and the 24-hour free-text refusal. These are exactly the risk details an agent needs for an irreversible send.

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

Conciseness3/5

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

Front-loaded with the action, and nearly every clause carries real information, but it is a single dense paragraph riddled with nested parentheses and colon-introduced asides. A 13-parameter destructive tool would be more scannable if the recipient, routing, consent and attachment rules were split into distinct labeled statements.

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

Completeness5/5

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

For a 13-parameter destructive operation with no output schema, the description covers recipient resolution, consent gating, provider selection, chat resolution, failure/duplicate-send semantics and attachment constraints. Little an agent needs in order to call it safely is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning the schema states only piecemeal: recipient exclusivity, to_number overriding a stored number, phone_number_id being required when the bot owns multiple numbers, chat_id defaulting to the linked channel, and body becoming a caption when an attachment is used.

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?

Opens with a specific verb and resource ('sends a WhatsApp message to a lead, a contact or a bare number') plus the side effect that distinguishes it ('records it on that record's timeline'). The provider-routing explanation further separates it from generic send tools in the sibling list.

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

Usage Guidelines4/5

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

Gives strong in-tool selection rules: exactly one of lead_id/contact_id/to_number, to_number as an override next to a record, dry_run:true for resolving without sending, document_id vs media_url exclusivity, and content_sid required outside the 24-hour window. It never explicitly says when to prefer this over a sibling such as send_brevo_whatsapp, so alternative-tool guidance is absent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.