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;
    }

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