Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

create_template

Create customizable WhatsApp Business message templates with dynamic variables for order confirmations, appointment reminders, and promotional communications.

Instructions

Create a new message template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoTemplate category
descriptionNoTemplate description
nameYesTemplate name
tagsNoTemplate tags
textYesTemplate text with {{variables}}
variablesNoList of variable names

Implementation Reference

  • Primary handler function for the 'create_template' MCP tool. It constructs the template object from input arguments and delegates to TemplateService.createTemplate, then formats and returns the result.
    private async handleCreateTemplate(args: any) {
      const template = await templateService.createTemplate({
        name: args.name,
        description: args.description,
        category: args.category,
        content: {
          text: args.text
        },
        variables: args.variables,
        tags: args.tags
      });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(template, null, 2)
          }
        ]
      };
    }
  • src/index.ts:223-245 (registration)
    Registration of the 'create_template' tool in the tools array, including name, description, and input schema definition.
    {
      name: 'create_template',
      description: 'Create a new message template',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Template name' },
          description: { type: 'string', description: 'Template description' },
          category: { type: 'string', description: 'Template category' },
          text: { type: 'string', description: 'Template text with {{variables}}' },
          variables: {
            type: 'array',
            items: { type: 'string' },
            description: 'List of variable names'
          },
          tags: {
            type: 'array',
            items: { type: 'string' },
            description: 'Template tags'
          }
        },
        required: ['name', 'text']
      }
  • Core helper method in TemplateService that generates ID, creates the MessageTemplate object, stores it in memory map, persists to file, and returns the new template.
    async createTemplate(template: Omit<MessageTemplate, 'id' | 'createdAt' | 'updatedAt'>): Promise<MessageTemplate> {
      const id = this.generateTemplateId(template.name);
      const newTemplate: MessageTemplate = {
        ...template,
        id,
        createdAt: new Date(),
        updatedAt: new Date()
      };
    
      this.templates.set(id, newTemplate);
      await this.saveCustomTemplates();
      return newTemplate;
    }
  • Dispatch case in the main CallToolRequestSchema handler that routes 'create_template' calls to the specific handleCreateTemplate method.
    case 'create_template':
      return await this.handleCreateTemplate(args);
  • JSON schema defining input validation for the 'create_template' tool parameters.
    inputSchema: {
      type: 'object',
      properties: {
        name: { type: 'string', description: 'Template name' },
        description: { type: 'string', description: 'Template description' },
        category: { type: 'string', description: 'Template category' },
        text: { type: 'string', description: 'Template text with {{variables}}' },
        variables: {
          type: 'array',
          items: { type: 'string' },
          description: 'List of variable names'
        },
        tags: {
          type: 'array',
          items: { type: 'string' },
          description: 'Template tags'
        }
      },
      required: ['name', 'text']
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Create' implies a write operation, it doesn't specify permissions needed, whether templates are immediately available for use, error conditions, or what happens on success/failure. For a creation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with good schema documentation and gets straight to the point with zero wasted verbiage.

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

Completeness2/5

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

For a creation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't address behavioral aspects like permissions, idempotency, or response format. While the schema covers parameters well, the description should provide more context about the creation operation itself given the lack of structured metadata.

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 parameters are fully documented in the schema. The description adds no additional parameter information beyond the basic purpose. It doesn't explain relationships between parameters (e.g., how 'variables' relates to 'text' placeholders) or provide usage examples, so it meets the baseline for high schema coverage.

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 ('Create') and resource ('new message template'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'update_template' or 'send_template', which would require mentioning it's for initial creation rather than modification or usage.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'update_template', 'delete_template', 'get_template', and 'search_templates', there's no indication of prerequisites, appropriate contexts, or distinctions between creation and other template operations.

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/luiso2/mcp-evolution-api'

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