Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

send_template_message

Send pre-approved WhatsApp Business template messages to initiate conversations outside the 24-hour window using Meta-approved templates with customizable variables.

Instructions

Send a pre-approved template message. Required for initiating conversations outside the 24-hour window. Templates must be approved by Meta before use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient phone number in international format
template_nameYesName of the approved template
languageNoTemplate language code (e.g., pt_BR, en_US)pt_BR
componentsNoTemplate components with variable values (header, body, button params)

Implementation Reference

  • Actual implementation of the WhatsApp template message sending logic.
    async sendTemplateMessage(
      to: string,
      templateName: string,
      language: string,
      components?: unknown[]
    ) {
      return this.request(`/${this.config.phoneNumberId}/messages`, "POST", {
        messaging_product: "whatsapp",
        to,
        type: "template",
        template: {
          name: templateName,
          language: { code: language },
          ...(components ? { components } : {}),
        },
      });
    }
  • src/index.ts:140-159 (registration)
    MCP tool registration for "send_template_message" which calls the handler in WhatsAppClient.
    server.tool(
      "send_template_message",
      "Send a pre-approved template message. Required for initiating conversations outside the 24-hour window. Templates must be approved by Meta before use.",
      {
        to: z.string().describe("Recipient phone number in international format"),
        template_name: z.string().describe("Name of the approved template"),
        language: z.string().default("pt_BR").describe("Template language code (e.g., pt_BR, en_US)"),
        components: z
          .array(z.record(z.string(), z.unknown()))
          .optional()
          .describe("Template components with variable values (header, body, button params)"),
      },
      async ({ to, template_name, language, components }) =>
        executeWithHooks(
          "send_template_message",
          { to, template_name, language, components },
          config,
          () => wa.sendTemplateMessage(to, template_name, language, components)
        )
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions that templates must be 'approved by Meta before use,' which adds important context about prerequisites. However, it lacks details about rate limits, error conditions, response format, or what happens if an unapproved template is used—significant gaps for a messaging tool.

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 two sentences with zero waste—each sentence adds critical information (what the tool does and when to use it). It's front-loaded with the core purpose and efficiently includes the key constraint about Meta approval.

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?

For a messaging tool with no annotations and no output schema, the description covers the basic purpose and a key usage constraint. However, it lacks details about behavioral aspects like authentication needs, error handling, or what the tool returns, leaving gaps that could hinder an agent's ability to use it correctly.

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 already documents all parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain template_name format or components structure). Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the action ('Send a pre-approved template message') and identifies the resource (template messages). It distinguishes from siblings like send_text_message or send_media_message by specifying template-based sending, though it doesn't explicitly contrast with send_interactive_message which might also use templates.

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?

The description provides clear context for when to use this tool ('Required for initiating conversations outside the 24-hour window'), which is specific and actionable. It doesn't explicitly mention when not to use it or name alternatives, but the context strongly implies it's for outbound messaging beyond the standard window.

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/EvandroSchechtel/mcp-whatsapp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server