Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

send_text_message

Send text messages to WhatsApp numbers within the 24-hour conversation window for customer communication and automated interactions.

Instructions

Send a text message to a WhatsApp number. Works within the 24-hour conversation window. For messages outside this window, use send_template_message instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient phone number in international format (e.g., 5541999999999)
bodyYesMessage text content
preview_urlNoWhether to show URL previews

Implementation Reference

  • The core handler function in WhatsAppClient that executes the API request to send a text message.
    async sendTextMessage(to: string, body: string, previewUrl = false) {
      return this.request(`/${this.config.phoneNumberId}/messages`, "POST", {
        messaging_product: "whatsapp",
        to,
        type: "text",
        text: { preview_url: previewUrl, body },
      });
  • src/index.ts:126-138 (registration)
    Registration of the send_text_message tool, including schema validation and the hook wrapper around the handler.
    server.tool(
      "send_text_message",
      "Send a text message to a WhatsApp number. Works within the 24-hour conversation window. For messages outside this window, use send_template_message instead.",
      {
        to: z.string().describe("Recipient phone number in international format (e.g., 5541999999999)"),
        body: z.string().describe("Message text content"),
        preview_url: z.boolean().optional().default(false).describe("Whether to show URL previews"),
      },
      async ({ to, body, preview_url }) =>
        executeWithHooks("send_text_message", { to, body, preview_url }, config, () =>
          wa.sendTextMessage(to, body, preview_url)
        )
    );
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the 24-hour window constraint, which is valuable behavioral context. However, it doesn't mention authentication requirements, rate limits, error conditions, or what happens on success/failure. For a messaging tool with zero annotation coverage, this leaves significant gaps.

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?

Two sentences with zero waste - first states purpose, second provides critical usage guidance. Perfectly front-loaded and appropriately sized for the tool's complexity.

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?

Given no annotations and no output schema, the description provides good context about the 24-hour window constraint and alternative tool. However, for a messaging tool that presumably returns success/failure status, the lack of output information is a minor gap. The description is mostly complete for its purpose.

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 three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. This meets the baseline expectation when schema coverage is high.

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 a text message') and target resource ('to a WhatsApp number'), distinguishing it from siblings like send_template_message, send_media_message, etc. It provides precise scope without being tautological.

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

Usage Guidelines5/5

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

Explicitly states when to use ('within the 24-hour conversation window') and when not to use ('outside this window'), with a clear alternative named ('use send_template_message instead'). This provides perfect guidance for tool selection.

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