Skip to main content
Glama

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
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)

Implementation Reference

  • 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}.`,
          },
        ],
      };
    }
  • 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":
  • 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",
      });
    }

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