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",
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the effect ('Archived chats are hidden from the main chat list') but doesn't mention whether this action is reversible (though 'waha_unarchive_chat' exists as a sibling), requires specific permissions, has side effects, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that directly state the action and its effect. Every word earns its place, and it's front-loaded with the core purpose, making it efficient and easy to parse without any wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects like reversibility, permissions, error conditions, or response format. While the schema covers the single parameter well, the overall context for safe and effective use is insufficient given the tool's complexity and lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'chatId' fully documented in the schema as 'Chat ID (format: number@c.us)'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for adequate coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Archive a chat') and the resource ('chat'), making the purpose immediately understandable. It distinguishes from siblings like 'waha_delete_chat' by specifying the effect ('hidden from the main chat list') rather than deletion. However, it doesn't explicitly contrast with 'waha_unarchive_chat' or other chat management tools, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'waha_delete_chat' or 'waha_unarchive_chat'. The description mentions the outcome ('hidden from the main chat list') but doesn't specify use cases, prerequisites, or exclusions, leaving the agent without contextual direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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