Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

create_template

Create message templates for WhatsApp Business to send outbound messages beyond the 24-hour window, requiring Meta approval for marketing, utility, or authentication purposes.

Instructions

Create a new message template for approval by Meta. Templates are required for outbound messages outside the 24-hour window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTemplate name (lowercase, underscores only)
languageNoTemplate language codept_BR
categoryYesTemplate category — affects pricing and approval rules
componentsYesTemplate components: HEADER, BODY, FOOTER, BUTTONS

Implementation Reference

  • src/index.ts:300-317 (registration)
    Tool registration for "create_template" which takes input parameters and calls the wa client.
    server.tool(
      "create_template",
      "Create a new message template for approval by Meta. Templates are required for outbound messages outside the 24-hour window.",
      {
        name: z.string().describe("Template name (lowercase, underscores only)"),
        language: z.string().default("pt_BR").describe("Template language code"),
        category: z
          .enum(["MARKETING", "UTILITY", "AUTHENTICATION"])
          .describe("Template category — affects pricing and approval rules"),
        components: z
          .array(z.record(z.string(), z.unknown()))
          .describe("Template components: HEADER, BODY, FOOTER, BUTTONS"),
      },
      async ({ name, language, category, components }) =>
        executeWithHooks("create_template", { name, language, category }, config, () =>
          wa.createTemplate({ name, language, category, components })
        )
    );
  • Implementation of createTemplate in the WhatsAppClient class, which makes the API call.
    async createTemplate(template: {
      name: string;
      language: string;
      category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
      components: unknown[];
    }) {
      return this.request(
        `/${this.config.businessAccountId}/message_templates`,
        "POST",
        template
      );
    }

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