Skip to main content
Glama

waha_unarchive_chat

Move archived WhatsApp chats back to the main chat list using the WAHA MCP Server. Restores access to previously hidden conversations by providing the chat ID.

Instructions

Unarchive a chat. Moves the chat back to the main chat list.

Input Schema

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

Implementation Reference

  • src/index.ts:299-312 (registration)
    MCP tool registration including name, description, and input schema definition.
    {
      name: "waha_unarchive_chat",
      description: "Unarchive a chat. Moves the chat back to the main chat list.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
        },
        required: ["chatId"],
      },
    },
  • Primary MCP tool handler function. Extracts chatId from arguments, validates it, calls the underlying WAHA client unarchiveChat method, and returns success message.
      const chatId = args.chatId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      await this.wahaClient.unarchiveChat(chatId);
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully unarchived chat ${chatId}.`,
          },
        ],
      };
    }
  • WAHA API client implementation. Constructs the endpoint URL and makes a POST request to the WAHA server to unarchive the specified chat.
     * Unarchive a chat
     * POST /api/:session/chats/:chatId/unarchive
     */
    async unarchiveChat(chatId: string): Promise<void> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(
        chatId
      )}/unarchive`;
    
      await this.request<void>(endpoint, {
        method: "POST",
      });
    }

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