Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

get_template

Retrieve a specific WhatsApp Business message template by ID for use in automated messaging workflows and customer communications.

Instructions

Get a specific template by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateIdYesTemplate ID

Implementation Reference

  • Main handler function for the 'get_template' tool. Retrieves the template by ID using templateService and returns it as JSON text content.
    private async handleGetTemplate(args: any) {
      const template = templateService.getTemplate(args.templateId);
      if (!template) {
        throw new Error(`Template ${args.templateId} not found`);
      }
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(template, null, 2)
          }
        ]
      };
    }
  • Tool registration in the tools list including input schema definition requiring 'templateId'.
      name: 'get_template',
      description: 'Get a specific template by ID',
      inputSchema: {
        type: 'object',
        properties: {
          templateId: { type: 'string', description: 'Template ID' }
        },
        required: ['templateId']
      }
    },
  • src/index.ts:510-511 (registration)
    Dispatch case in the main CallToolRequestHandler switch statement that routes to the specific handler.
    case 'get_template':
      return await this.handleGetTemplate(args);
  • Core helper method in templateService that fetches a template from the internal Map by ID.
    getTemplate(id: string): MessageTemplate | undefined {
      return this.templates.get(id);
    }

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