Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

list_templates

Retrieve available WhatsApp message templates for business messaging, with options to filter by category or tags to find suitable templates for order confirmations, appointment reminders, or promotional messages.

Instructions

List all message templates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category
tagsNoFilter by tags

Implementation Reference

  • Main handler function for the 'list_templates' tool. It checks input arguments for category or tags filters and calls the appropriate TemplateService method to retrieve templates, then returns them as JSON text content.
    private async handleListTemplates(args: any) { let templates; if (args.category) { templates = templateService.getTemplatesByCategory(args.category); } else if (args.tags && args.tags.length > 0) { templates = templateService.getTemplatesByTags(args.tags); } else { templates = templateService.getAllTemplates(); } return { content: [ { type: 'text', text: JSON.stringify(templates, null, 2) } ] }; }
  • Input schema for the list_templates tool, defining optional category (string) and tags (array of strings) parameters for filtering templates.
    inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter by category' }, tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags' } } }
  • src/index.ts:197-211 (registration)
    Tool definition object registered in the 'tools' array, which is returned by the ListTools handler.
    { name: 'list_templates', description: 'List all message templates', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter by category' }, tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags' } } } },
  • src/index.ts:508-509 (registration)
    Switch case in the CallToolRequest handler that dispatches 'list_templates' calls to the specific handleListTemplates method.
    case 'list_templates': return await this.handleListTemplates(args);
  • Core helper method in TemplateService that retrieves all templates from the internal map, used by the handler when no filters are specified.
    getAllTemplates(): MessageTemplate[] { return Array.from(this.templates.values()); }

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