Skip to main content
Glama

waha_get_presence

Check WhatsApp chat status (online/offline/typing) by providing a chat ID. Automatically subscribes to status updates if not already active.

Instructions

Get online/offline/typing status for a chat. Auto-subscribes if not already subscribed.

Input Schema

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

Implementation Reference

  • The primary handler function for the 'waha_get_presence' MCP tool. Extracts chatId from arguments, validates it, calls the WAHA client's getPresence method, and returns formatted presence data as text content.
    private async handleGetPresence(args: any) {
      const chatId = args.chatId;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      const presence = await this.wahaClient.getPresence(chatId);
    
      return {
        content: [
          {
            type: "text",
            text: `Presence information for ${chatId}:\n${JSON.stringify(presence, null, 2)}`,
          },
        ],
      };
    }
  • The input schema and metadata definition for the 'waha_get_presence' tool, provided in the ListTools response. Specifies required chatId parameter.
    name: "waha_get_presence",
    description: "Get online/offline/typing status for a chat. Auto-subscribes if not already subscribed.",
    inputSchema: {
      type: "object",
      properties: {
        chatId: {
          type: "string",
          description: "Chat ID (format: number@c.us)",
        },
      },
      required: ["chatId"],
    },
  • src/index.ts:1150-1150 (registration)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement, routing calls to the handleGetPresence method.
    return await this.handleGetPresence(args);
  • Underlying WAHAClient method that makes the HTTP GET request to retrieve presence information for a specific chat from the WAHA API.
    async getPresence(chatId: string): Promise<any> {
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const endpoint = `/api/${this.session}/presence/${encodeURIComponent(chatId)}`;
    
      return this.request<any>(endpoint, {
        method: "GET",
      });
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the auto-subscription behavior, which is valuable beyond basic functionality. However, it lacks details on permissions needed, rate limits, error conditions, or what the return format looks like (e.g., structured data or simple status).

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 front-loads the core purpose and adds the auto-subscription detail without waste. Every word earns its place, making it easy to parse quickly.

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

Completeness3/5

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

Given no annotations and no output schema, the description is moderately complete. It covers the tool's purpose and a key behavioral trait (auto-subscription), but lacks details on return values, error handling, or prerequisites. For a tool with 1 parameter and 100% schema coverage, it's adequate but has clear gaps in behavioral context.

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 fully documents the chatId parameter. The description doesn't add any meaning beyond what's in the schema (e.g., it doesn't clarify format beyond 'number@c.us' or provide examples). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Get online/offline/typing status') and resource ('for a chat'), distinguishing it from sibling tools like waha_get_all_presence (which gets presence for all contacts) and waha_set_presence (which sets presence). It precisely defines what the tool retrieves.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool by mentioning 'Auto-subscribes if not already subscribed,' which implies it's for monitoring a specific chat's presence. However, it doesn't explicitly state when not to use it or name alternatives like waha_get_all_presence for broader monitoring.

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