Skip to main content
Glama

waha_subscribe_presence

Monitor real-time online/offline status for WhatsApp chats to track contact availability and engagement patterns.

Instructions

Subscribe to presence updates for a chat.

Input Schema

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

Implementation Reference

  • src/index.ts:1001-1013 (registration)
    Tool registration and schema definition in the ListTools response. Defines name, description, and input schema requiring chatId.
      name: "waha_subscribe_presence",
      description: "Subscribe to presence updates for a chat.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
        },
        required: ["chatId"],
      },
    },
  • Primary handler function for the tool. Validates input, calls the WAHA client method, and returns formatted success response.
    private async handleSubscribePresence(args: any) {
      const chatId = args.chatId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      await this.wahaClient.subscribePresence(chatId);
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully subscribed to presence updates for ${chatId}.`,
          },
        ],
      };
    }
  • WAHAClient helper method that performs the actual HTTP POST request to the WAHA API to subscribe to presence updates for the specified chat.
    async subscribePresence(chatId: string): Promise<void> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const endpoint = `/api/${this.session}/presence/${encodeURIComponent(chatId)}/subscribe`;
    
      await this.request<void>(endpoint, {
        method: "POST",
      });
    }
  • Tool dispatcher in the CallToolRequest handler switch statement that routes to the specific handler function.
    case "waha_set_presence":
      return await this.handleSetPresence(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Subscribe to presence updates,' implying a continuous or event-driven operation, but fails to specify whether this is a long-running connection, how updates are delivered (e.g., via callbacks or streams), what happens on errors, or if there are rate limits. This leaves critical behavioral aspects unclear for an agent.

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, clear sentence with no wasted words. It's front-loaded with the core action ('Subscribe to presence updates') and specifies the target ('for a chat'), making it highly efficient and easy to parse.

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?

Given the complexity of a subscription tool (which likely involves ongoing updates or event handling), the description is insufficient. No annotations are provided to clarify behavior, and there's no output schema to indicate what the tool returns (e.g., a subscription ID, confirmation, or error). This leaves the agent with significant gaps in understanding how to invoke and handle this tool effectively.

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?

The input schema has 100% description coverage, with 'chatId' clearly documented as 'Chat ID (format: number@c.us)'. The description doesn't add any additional meaning beyond this, such as examples or constraints on valid chat IDs. With high schema coverage, a baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 verb ('Subscribe to') and resource ('presence updates for a chat'), making the purpose specific and understandable. However, it doesn't distinguish this tool from sibling tools like 'waha_get_presence' or 'waha_get_all_presence', which appear to be read operations rather than subscription-based ones.

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?

The description provides no guidance on when to use this tool versus alternatives like 'waha_get_presence' or 'waha_get_all_presence'. There's no mention of prerequisites, such as needing an active connection or specific permissions, or when this subscription might be preferable to one-time presence checks.

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