waha_set_presence
Update your WhatsApp presence status to online, offline, typing, recording, or paused for specific chats to indicate availability and activity.
Instructions
Set your own presence status (online, offline, typing, recording, or paused).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chatId | Yes | Chat ID (format: number@c.us) | |
| presence | Yes | Presence status to set |
Implementation Reference
- src/index.ts:1015-1032 (schema)Input schema and description for the waha_set_presence tool, returned by listTools endpoint.name: "waha_set_presence", description: "Set your own presence status (online, offline, typing, recording, or paused).", inputSchema: { type: "object", properties: { chatId: { type: "string", description: "Chat ID (format: number@c.us)", }, presence: { type: "string", enum: ["online", "offline", "typing", "recording", "paused"], description: "Presence status to set", }, }, required: ["chatId", "presence"], }, },
- src/index.ts:1153-1154 (registration)Registration of the waha_set_presence tool handler in the CallToolRequestSchema switch statement.case "waha_set_presence": return await this.handleSetPresence(args);
- src/index.ts:2632-2657 (handler)Main handler function for waha_set_presence tool call, validates parameters and delegates to WAHAClient.setPresence method.private async handleSetPresence(args: any) { const chatId = args.chatId; const presence = args.presence; if (!chatId) { throw new Error("chatId is required"); } if (!presence) { throw new Error("presence is required"); } await this.wahaClient.setPresence({ chatId, presence, }); return { content: [ { type: "text", text: `Successfully set presence to "${presence}" for ${chatId}.`, }, ], }; }
- src/client/waha-client.ts:1427-1450 (helper)WAHAClient helper method that performs the actual HTTP POST request to the WAHA API to set the presence status for a specific chat.async setPresence(params: { chatId: string; presence: "online" | "offline" | "typing" | "recording" | "paused"; }): Promise<void> { const { chatId, presence } = params; if (!chatId) { throw new WAHAError("chatId is required"); } if (!presence) { throw new WAHAError("presence is required"); } const body = { chatId, presence, }; await this.request<void>(`/api/${this.session}/presence`, { method: "POST", body: JSON.stringify(body), }); }