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);

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