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());
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't mention whether this is a read-only operation, if there are rate limits, authentication requirements, pagination behavior, or what the return format looks like. For a list operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 extremely concise at just four words, with zero wasted language. It's front-loaded with the core action and resource, making it immediately understandable without any unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what 'list all' means in practice (e.g., pagination, limits), how results are structured, or how it differs from 'search_templates'. For a tool with filtering parameters and sibling alternatives, more context is needed.

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?

The schema description coverage is 100%, with both parameters ('category' and 'tags') well-documented in the input schema. The description doesn't add any additional meaning about these parameters beyond what's already in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 'List all message templates' clearly states the verb ('List') and resource ('message templates'), making the tool's purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'search_templates', which suggests there might be overlapping functionality without clear boundaries.

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 like 'search_templates' or 'get_template'. There's no mention of prerequisites, context for filtering, or any exclusions that would help an agent choose appropriately among similar tools.

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