Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

delete_template

Remove a custom WhatsApp Business message template by its ID to manage your template library and maintain relevant messaging content.

Instructions

Delete a custom template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateIdYesTemplate ID to delete

Implementation Reference

  • MCP tool handler function that invokes the template service to delete a template by ID and returns a success or failure message in the required MCP content format.
    private async handleDeleteTemplate(args: any) {
      const deleted = await templateService.deleteTemplate(args.templateId);
      return {
        content: [
          {
            type: 'text',
            text: deleted ? 'Template deleted successfully' : 'Cannot delete default template or template not found'
          }
        ]
      };
    }
  • src/index.ts:264-274 (registration)
    Tool registration entry in the tools array provided to the MCP ListTools handler, including name, description, and input schema.
    {
      name: 'delete_template',
      description: 'Delete a custom template',
      inputSchema: {
        type: 'object',
        properties: {
          templateId: { type: 'string', description: 'Template ID to delete' }
        },
        required: ['templateId']
      }
    },
  • Input schema definition for the delete_template tool, specifying the required templateId parameter.
    inputSchema: {
      type: 'object',
      properties: {
        templateId: { type: 'string', description: 'Template ID to delete' }
      },
      required: ['templateId']
  • TemplateService method that performs the actual deletion: checks if not default, removes from internal Map, saves to storage, returns boolean success.
    async deleteTemplate(id: string): Promise<boolean> {
      // Don't delete default templates
      if (DEFAULT_TEMPLATES.find(t => t.id === id)) {
        return false;
      }
    
      const deleted = this.templates.delete(id);
      if (deleted) {
        await this.saveCustomTemplates();
      }
      return deleted;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description must disclose behavioral traits, but it only states the action. It does not mention irreversibility, required permissions, or side effects (e.g., impact on existing messages or instances using the template). 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (one sentence, four words) with no wasted words. However, it could be slightly expanded to include a caution or context without losing conciseness.

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 simple one-parameter delete action, the description covers the basic purpose and required input. However, it lacks any mention of return value, confirmation, or potential consequences, so it is minimally complete.

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 coverage is 100% and the schema already describes the parameter as 'Template ID to delete.' The tool description adds no additional meaning beyond that, so the baseline score applies.

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 (delete) and resource (custom template), making the purpose obvious. It is distinct from sibling tools like create_template or list_templates, though it does not elaborate on what qualifies as a custom template.

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?

No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or caveats. There are no other delete tools, but the description misses context such as checking template usage before deletion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.