Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

search_templates

Find predefined WhatsApp message templates for business scenarios like order confirmations, appointment reminders, and promotional messages by entering search terms.

Instructions

Search templates by text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • The handler function for the 'search_templates' tool. It calls templateService.searchTemplates with the query argument and returns the results as a JSON-formatted text response.
    private async handleSearchTemplates(args: any) {
      const templates = templateService.searchTemplates(args.query);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(templates, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the 'search_templates' tool, specifying a required 'query' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        query: { type: 'string', description: 'Search query' }
      },
      required: ['query']
  • src/index.ts:294-304 (registration)
    Registration of the 'search_templates' tool in the MCP tools array, including name, description, and input schema.
    {
      name: 'search_templates',
      description: 'Search templates by text',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query' }
        },
        required: ['query']
      }
    },
  • The core helper method in TemplateService that performs the actual template search by filtering on name, description, tags, and category.
    searchTemplates(query: string): MessageTemplate[] {
      const lowerQuery = query.toLowerCase();
      return Array.from(this.templates.values()).filter(template => {
        return (
          template.name.toLowerCase().includes(lowerQuery) ||
          template.description?.toLowerCase().includes(lowerQuery) ||
          template.tags?.some(tag => tag.toLowerCase().includes(lowerQuery)) ||
          template.category?.toLowerCase().includes(lowerQuery)
        );
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't disclose whether this is a read-only operation, how results are returned (e.g., pagination, sorting), error conditions, or performance characteristics like rate limits. The phrase 'by text' hints at content searching but lacks detail.

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 extremely concise with just three words, making it front-loaded and efficient. However, it may be overly terse, potentially sacrificing clarity for brevity, as it lacks necessary context for effective use.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It fails to explain what 'templates' refer to in this context (e.g., message templates, document templates), how results are structured, or any prerequisites. For a search tool, this leaves significant gaps in understanding.

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 description coverage is 100%, with the 'query' parameter documented as 'Search query'. The description adds no additional meaning beyond this, such as query syntax, examples, or search scope (e.g., partial matches, case sensitivity). Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search templates by text' clearly states the verb (search) and resource (templates), but it's vague about scope and lacks differentiation from sibling tools like 'list_templates' or 'get_template'. It doesn't specify whether this searches content, metadata, or both.

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 like 'list_templates' (which might list all templates without search) or 'get_template' (which retrieves a specific template by ID). The description implies text-based searching but doesn't clarify use cases or exclusions.

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