Skip to main content
Glama
YCloud-Developers

YCloud WhatsApp API MCP Server

wa_template_delete_by_name

Delete WhatsApp message templates by specifying their name to manage and clean up template lists.

Instructions

Delete templates by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • src/tools.ts:95-98 (registration)
    Remaps OpenAPI operation IDs containing 'template-delete-by-name-and-language' or 'whatsapp_template-delete-by-name-and-language' to the MCP tool name 'wa_template_delete'
    } else if (operationId.includes('template-delete-by-name-and-language') || 
              operationId.includes('whatsapp_template-delete-by-name-and-language')) {
      operationId = 'wa_template_delete';
    } else if (operationId.includes('template-edit-by-name-and-language') || 
  • Extracts Zod input schema from OpenAPI operation parameters and requestBody for wa_template_delete and other tools
    function extractParamsSchema(operation: any): any {
      const properties: Record<string, any> = {};
      const required: string[] = [];
    
      // 处理路径参数
      if (operation.parameters) {
        operation.parameters.forEach((param: any) => {
          if (param.in === 'path' || param.in === 'query') {
            let schema;
            switch (param.schema?.type) {
              case 'string':
                schema = z.string();
                break;
              case 'integer':
                schema = z.number().int();
                break;
              case 'number':
                schema = z.number();
                break;
              case 'boolean':
                schema = z.boolean();
                break;
              default:
                schema = z.any();
            }
            
            properties[param.name] = schema;
            if (param.required) {
              required.push(param.name);
            }
          }
        });
      }
    
      // 处理请求体
      if (operation.requestBody) {
        properties['body'] = z.any();
        required.push('body');
      }
    
      return properties;
    }
  • Generic handler function that registers the 'wa_template_delete' tool and proxies requests to the corresponding YCloud WhatsApp API endpoint for deleting templates by name and language
    server.tool(
      toolName,
      description,
      paramsSchema,
      async (args: Record<string, any>) => {
        try {
          // 解析URL中的路径参数
          let url = `${apiBaseUrl}${path}`;
          Object.keys(args).forEach(key => {
            if (path.includes(`{${key}}`)) {
              url = url.replace(`{${key}}`, encodeURIComponent(String(args[key])));
              delete args[key];
            }
          });
          
          // 提取请求体和查询参数
          const { body, ...queryParams } = args as Record<string, any>;
          
          // 设置请求选项
          const requestOptions: any = {
            url,
            method: method.toUpperCase(),
            headers: { 
              'Content-Type': 'application/json',
              ...headers
            },
            params: Object.keys(queryParams).length > 0 ? queryParams : undefined,
            data: body,
          };
          
          // 发送请求
          const response = await axios(requestOptions);
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(response.data, null, 2) }]
          };
        } catch (error: unknown) {
          if (axios.isAxiosError(error) && error.response) {
            return {
              content: [{
                type: 'text' as const,
                text: JSON.stringify({
                  error: true,
                  status: error.response.status,
                  message: error.response.data?.message || error.message,
                  data: error.response.data
                }, null, 2)
              }]
            };
          }
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({
                error: true,
                message: error instanceof Error ? error.message : String(error)
              }, null, 2)
            }]
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the destructive action (delete) but doesn't mention permissions required, whether deletion is permanent/reversible, rate limits, error conditions, or what happens if the template doesn't exist. This is inadequate for a destructive operation.

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 three words, front-loading the essential information with zero wasted text. Every word earns its place by specifying action, resource, and method.

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?

For a destructive tool with no annotations, 0% schema coverage, and no output schema, the description is insufficient. It doesn't cover behavioral aspects like safety, permissions, or response format, nor does it provide adequate parameter guidance despite the concise statement of purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'by name' which clarifies the single parameter's purpose, but doesn't explain name format, case sensitivity, validation rules, or provide examples. The parameter remains largely undocumented.

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 'Delete templates by name' clearly states the action (delete) and target resource (templates), with the qualifier 'by name' indicating the deletion method. It distinguishes from the sibling 'wa_template_delete' which likely deletes by ID or other identifier, though this distinction isn't explicitly stated.

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 'wa_template_delete' or other template management tools. The description doesn't mention prerequisites, constraints, or appropriate contexts for invocation.

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/YCloud-Developers/ycloud-whatsapp-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server