Skip to main content
Glama

Send a Meta-approved WhatsApp template

send_whatsapp_template
Destructive

Send a Meta-approved WhatsApp template

Templates can be sent at any time, including outside the 24-hour customer-service window. The template must be pre-approved by Meta for the agent's WhatsApp Business Account; listWhatsAppTemplates shows each template's status and what to fill in. Before queuing, Mojeeb checks the name and language against the number's templates (422 template_not_found or template_not_found_for_language). That check accepts a template whatever its status, so one that isn't approved fails at Meta instead. The check is skipped when Mojeeb can't read the templates from Meta, and when the number has more than 100 templates and the name or language isn't among the 100 Mojeeb reads: the send is then accepted (202) and Meta's verdict shows in its status.

The agent is the body's agent_id, judged as for sendWhatsAppMessage.

The MCP server sends this call with an idempotency key of its own, so a retry after a timeout never sends it twice.

Input Schema

NameRequiredDescriptionDefault
toYesE.164 international phone number — leading `+`, country code, then 7–15 digits. No spaces, dashes, or parens.
fromYesE.164 international phone number — leading `+`, country code, then 7–15 digits. No spaces, dashes, or parens.
agent_idYesID of the Mojeeb agent to send from.
templateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / template / properties / header_media_url / description
      Previous value: -"For templates with an IMAGE / VIDEO / DOCUMENT header — a public\nURL pointing at the asset you want delivered to the recipient.\nWhen omitted, Mojeeb re-hosts the approval-time sample image so\nevery recipient gets the template's default asset.\n\n**Requirements (enforced by Meta, not Mojeeb):**\n  - HTTPS only.\n  - Must be publicly reachable from Meta's servers (no\n    intranet/VPN-only URLs; Meta does the fetch, not Mojeeb).\n  - MIME and size must match Meta's per-format limits — e.g.\n    JPG/PNG ≤ 5 MB for IMAGE, MP4 ≤ 16 MB for VIDEO,\n    PDF ≤ 100 MB for DOCUMENT.\n\nIf the URL is unreachable or rejected, the send transitions to\n`status: failed` (visible via `GET /v1/whatsapp/messages/{id}`).\n"New value: +"For templates with an IMAGE / VIDEO / DOCUMENT header — a public\nURL pointing at the asset you want delivered to the recipient,\nor the `url` of a Mojeeb upload of the agent (`createUpload`), which\nMojeeb hands to WhatsApp itself (JPEG, PNG, MP4 or PDF, up to 16 MB).\nWhen omitted, Mojeeb re-hosts the approval-time sample image so\nevery recipient gets the template's default asset.\n\n**Requirements (enforced by Meta, not Mojeeb):**\n  - HTTPS only.\n  - Must be publicly reachable from Meta's servers (no\n    intranet/VPN-only URLs; Meta does the fetch, not Mojeeb).\n  - MIME and size must match Meta's per-format limits — e.g.\n    JPG/PNG ≤ 5 MB for IMAGE, MP4 ≤ 16 MB for VIDEO,\n    PDF ≤ 100 MB for DOCUMENT.\n\nIf the URL is unreachable or rejected, the send transitions to\n`status: failed` (visible via `GET /v1/whatsapp/messages/{id}`).\n"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

The description adds substantial behavior beyond annotations: pre-approval requirements, template name/language validation, the 422 failure modes, the skipped validation cases, the 202 acceptance path, and idempotency-key retry behavior. These details materially change how an agent should interpret and retry calls.

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 purpose is front-loaded, and the longer body is justified by the tool's approval, validation, fallback, and idempotency edge cases. The sentences are dense but each conveys operational information an agent needs.

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

Completeness4/5

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

Coverage is strong for a complex send tool with no output schema: approval, validation, skipped checks, failure modes, and retry behavior are all disclosed. It implies response behavior via 202 and status lookups but does not fully describe the success response shape.

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 75% and the nested template schema already documents most parameter semantics in detail. The description adds some useful context for agent_id and template status checks, but it does not meaningfully explain the remaining fields beyond what the schema provides.

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 states a specific verb and resource: sending a Meta-approved WhatsApp template. It clearly scopes the tool by template status, language, and send-time behavior, which distinguishes it from the generic message-sending sibling.

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?

It explains when templates may be used, including outside the 24-hour customer-service window, and directs the caller to listWhatsAppTemplates to check approval and fill-in details. It does not explicitly compare this tool against send_whatsapp_message, so it stops short of full alternative routing guidance.

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.

Resources