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
| Name | Required | Description | Default |
|---|---|---|---|
| chatId | Yes | Chat 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 handlername: "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"], }, },
- src/index.ts:1488-1505 (handler)Main handler function that processes 'waha_delete_chat' tool calls, validates input, calls WAHAClient.deleteChat, and returns confirmationprivate 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.`, }, ], }; }
- src/client/waha-client.ts:435-445 (handler)WAHAClient.deleteChat method - core API implementation that makes the DELETE request to WAHA API to delete the chatasync 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", }); }