Skip to main content
Glama

waha_delete_chat

Permanently remove WhatsApp conversations from the WAHA MCP Server. This irreversible action deletes chat history and all associated messages.

Instructions

Delete a chat completely. WARNING: This is a destructive operation that cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)

Implementation Reference

  • src/index.ts:272-284 (registration)
    Tool registration and input schema definition for 'waha_delete_chat' in the listTools handler
      name: "waha_delete_chat",
      description: "Delete a chat completely. WARNING: This is a destructive operation that cannot be undone.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
        },
        required: ["chatId"],
      },
    },
  • Main handler function that processes 'waha_delete_chat' tool calls, validates input, calls WAHAClient.deleteChat, and returns confirmation
    private async handleDeleteChat(args: any) {
      const chatId = args.chatId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      await this.wahaClient.deleteChat(chatId);
    
      return {
        content: [
          {
            type: "text",
            text: `WARNING: Chat ${chatId} has been completely deleted.\nThis operation cannot be undone.`,
          },
        ],
      };
    }
  • WAHAClient.deleteChat method - core API implementation that makes the DELETE request to WAHA API to delete the chat
    async deleteChat(chatId: string): Promise<void> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(chatId)}`;
    
      await this.request<void>(endpoint, {
        method: "DELETE",
      });
    }

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-mcp'

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