Skip to main content
Glama

ingest_whatsapp_lead

Destructive

Take an incoming WhatsApp message and turn it into (or attach it to) a lead — the intake path for Click-to-WhatsApp ads. Pass the raw webhook payload (or just the referral object) as payload and the sender's number; the ad reference is read from it. IMPORTANT: the referral only arrives with the FIRST message of a conversation, so it is recorded once and never overwritten by a later message that has none. Writing the same number twice does not create a second lead — the message joins the existing one. A message without an ad reference is still taken in, explicitly marked 'Herkunft unbekannt': someone wrote, that is the event; discarding it loses a real enquiry, and attributing it to whichever ad happens to run would be an invented number in the ad report.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "from": "<from>"
    },
    "name": "ingest_whatsapp_lead"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromYesThe sender's phone number, any format.
nameNoProfile name, if WhatsApp supplied one.
textNoThe message text.
payloadNoThe raw webhook bundle, a single message, or the referral object. The ad reference is read from whichever it is.
message_idNoWhatsApp message id (wamid.…) — the guard against double delivery.
campaign_idNoCampaign to file the lead under.
received_atNoISO timestamp of the message.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the referral is captured only on the first message and never overwritten, the same number joins the existing lead instead of duplicating, and unattributed messages are recorded as 'Herkunft unbekannt' rather than misattributed. These are non-obvious state and dedupe semantics an agent could not infer from readOnlyHint/destructiveHint/idempotentHint alone. Minor tension: destructiveHint=true while the text stresses nothing is overwritten, but this reflects the write-mutation nature rather than a direct contradiction.

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

Conciseness4/5

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

Front-loaded with what the tool does and the key call shape, then behavior. The final sentence's rationale for not discarding ad-less messages is a bit long, but it justifies a design decision that would otherwise lead an agent to reject valid input.

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?

With 7 parameters, a nested object, no output schema, and destructive/write annotations, the description covers what happens on repeat writes, what happens without an ad reference, and how attribution is derived. That is enough for an agent to call this correctly on webhook traffic.

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 baseline would be 3, but the description adds real meaning: `payload` may be a full webhook bundle, a single message, or just the referral object, and the ad reference is extracted from it; `from` is the sender's number used for dedupe. It clarifies the flexible shape of the one nested/complex parameter, which the schema glosses over.

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?

States a specific verb and resource ('take an incoming WhatsApp message and turn it into (or attach it to) a lead') plus the scope ('the intake path for Click-to-WhatsApp ads'). This distinguishes it from create_lead, add_lead_message, and the ingest_* siblings without needing their schemas.

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?

Explains the invocation context clearly: call it with the raw webhook payload or just the referral object, and it clarifies that an ad-less message should still be ingested rather than rejected. It does not explicitly name an alternative tool for manual lead creation (create_lead) or message appending, so it stops short of full alternative routing.

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.