waha_archive_chat
Archive WhatsApp chats to hide them from the main chat list. Manage chat organization by archiving conversations using their chat ID.
Instructions
Archive a chat. Archived chats are hidden from the main chat list.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chatId | Yes | Chat ID (format: number@c.us) |
Implementation Reference
- src/index.ts:1511-1527 (handler)MCP tool handler function that extracts chatId from arguments, validates it, calls wahaClient.archiveChat, and returns success text response.const chatId = args.chatId; if (!chatId) { throw new Error("chatId is required"); } await this.wahaClient.archiveChat(chatId); return { content: [ { type: "text", text: `Successfully archived chat ${chatId}.`, }, ], }; }
- src/index.ts:286-298 (schema)Input schema definition for the waha_archive_chat tool, specifying chatId as required string parameter.name: "waha_archive_chat", description: "Archive a chat. Archived chats are hidden from the main chat list.", inputSchema: { type: "object", properties: { chatId: { type: "string", description: "Chat ID (format: number@c.us)", }, }, required: ["chatId"], }, },
- src/index.ts:1072-1073 (registration)Dispatch in CallToolRequestSchema switch statement that routes calls to the waha_archive_chat handler.return await this.handleArchiveChat(args); case "waha_unarchive_chat":
- src/client/waha-client.ts:451-463 (helper)WAHAClient helper method that performs POST request to WAHA API /chats/{chatId}/archive endpoint to archive the chat.async archiveChat(chatId: string): Promise<void> { if (!chatId) { throw new WAHAError("chatId is required"); } const endpoint = `/api/${this.session}/chats/${encodeURIComponent( chatId )}/archive`; await this.request<void>(endpoint, { method: "POST", }); }