Skip to main content
Glama

waha_delete_message

Remove a specific message from a WhatsApp chat using the WAHA MCP Server. This destructive operation permanently deletes the selected message.

Instructions

Delete a specific message from a chat. This is a destructive operation and cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)
messageIdYesMessage ID to delete (format: {fromMe}_{chat}_{message_id}[_{participant}])

Implementation Reference

  • src/index.ts:165-183 (registration)
    Tool registration including schema and description in ListToolsRequestSchema handler
    },
    {
      name: "waha_delete_message",
      description: "Delete a specific message from a chat. This is a destructive operation and cannot be undone.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
          messageId: {
            type: "string",
            description: "Message ID to delete (format: {fromMe}_{chat}_{message_id}[_{participant}])",
          },
        },
        required: ["chatId", "messageId"],
      },
    },
  • Main MCP tool handler that validates parameters, calls WAHAClient.deleteMessage, and returns formatted success response
    private async handleDeleteMessage(args: any) {
      const chatId = args.chatId;
      const messageId = args.messageId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      if (!messageId) {
        throw new Error("messageId is required");
      }
    
      await this.wahaClient.deleteMessage(chatId, messageId);
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully deleted message ${messageId} from chat ${chatId}.`,
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying required chatId and messageId parameters
    inputSchema: {
      type: "object",
      properties: {
        chatId: {
          type: "string",
          description: "Chat ID (format: number@c.us)",
        },
        messageId: {
          type: "string",
          description: "Message ID to delete (format: {fromMe}_{chat}_{message_id}[_{participant}])",
        },
      },
      required: ["chatId", "messageId"],
    },
  • WAHAClient helper method that performs the actual HTTP DELETE request to the WAHA API endpoint for deleting a message
    async deleteMessage(chatId: string, messageId: string): Promise<void> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      if (!messageId) {
        throw new WAHAError("messageId is required");
      }
    
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(
        chatId
      )}/messages/${encodeURIComponent(messageId)}`;
    
      await this.request<void>(endpoint, {
        method: "DELETE",
      });
    }
Behavior4/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. It explicitly states this is a 'destructive operation and cannot be undone,' which is crucial context for a mutation tool. However, it lacks details on permissions needed, rate limits, or what happens if the message doesn't exist. The warning is valuable but incomplete for full transparency.

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 two sentences with zero waste: the first states the purpose, and the second provides a critical behavioral warning. It's front-loaded with the core action and efficiently communicates essential information without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is minimally complete. It covers the purpose and a key warning but lacks details on permissions, error conditions, or response format. Given the complexity of deletion operations, more context would be beneficial, but it's adequate for basic use.

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 both parameters (chatId and messageId) clearly documented in the schema with format details. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline score of 3 for adequate but not enhanced parameter semantics.

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

Purpose5/5

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

The description clearly states the specific action ('Delete a specific message') and resource ('from a chat'), distinguishing it from sibling tools like waha_clear_chat_messages (which deletes all messages in a chat) and waha_edit_message (which modifies rather than removes). The verb 'delete' is precise and unambiguous.

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 waha_edit_message for corrections or waha_clear_chat_messages for bulk removal. It mentions the operation is 'destructive and cannot be undone,' but this is a behavioral warning rather than usage context. No explicit when/when-not instructions or sibling comparisons are included.

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/seejux/waha-whatsapp-mcp'

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