Skip to main content
Glama

waha_unpin_message

Remove a pinned message from a WhatsApp chat to clear the pinned message slot and manage chat organization.

Instructions

Unpin a message in a chat.

Input Schema

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

Implementation Reference

  • src/index.ts:239-256 (registration)
    Tool registration and schema definition in the ListToolsRequestSchema handler. Defines name, description, and input schema (chatId and messageId required).
    {
      name: "waha_unpin_message",
      description: "Unpin a message in a chat.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
          messageId: {
            type: "string",
            description: "Message ID to unpin",
          },
        },
        required: ["chatId", "messageId"],
      },
    },
  • MCP tool handler function. Validates input parameters (chatId, messageId), calls the WAHA client unpinMessage method, and returns success message.
     * Handle waha_unpin_message tool
     */
    private async handleUnpinMessage(args: any) {
      const chatId = args.chatId;
      const messageId = args.messageId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      if (!messageId) {
        throw new Error("messageId is required");
      }
    
      await this.wahaClient.unpinMessage(chatId, messageId);
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully unpinned message ${messageId} from chat ${chatId}.`,
          },
        ],
      };
    }
  • src/index.ts:1064-1067 (registration)
    Tool dispatch registration in the CallToolRequestSchema switch statement. Routes calls to waha_unpin_message to the handleUnpinMessage handler.
      return await this.handlePinMessage(args);
    case "waha_unpin_message":
      return await this.handleUnpinMessage(args);
    case "waha_clear_chat_messages":
  • Underlying WAHA client method that performs the actual HTTP POST request to unpin the message via the WAHA API endpoint.
    async unpinMessage(chatId: string, messageId: string): Promise<void> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      if (!messageId) {
        throw new WAHAError("messageId is required");
      }
    
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(
        chatId
      )}/messages/${encodeURIComponent(messageId)}/unpin`;
    
      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 full burden but only states the basic action. It doesn't disclose behavioral traits such as whether this requires specific permissions, if it's reversible, what happens on success/failure, or any rate limits. The description is minimal and lacks crucial operational context.

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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately front-loaded and gets straight to the point.

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 inadequate. It doesn't explain what happens after unpinning (e.g., success response, error cases), doesn't mention dependencies (message must be pinned), and provides no behavioral context. The tool name and description suggest it modifies chat state, but crucial details are missing.

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%, so the schema already documents both parameters (chatId and messageId) with their formats. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high schema coverage.

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 ('Unpin') and resource ('a message in a chat'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from its sibling 'waha_pin_message' beyond the obvious opposite action, missing an opportunity to clarify the relationship.

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. While the action is straightforward (unpinning), there's no mention of prerequisites (e.g., the message must be pinned first), error conditions, or contextual constraints like chat type limitations.

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