Send Presence
send_presenceSend typing, recording, or status updates to a WhatsApp chat to simulate user activity. Control the duration of the presence indicator.
Instructions
Send a presence update (typing, recording, etc.) to a chat via the pinned instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Recipient JID or phone number (e.g. 5511999999999 or group@g.us) | |
| presence | Yes | Presence status to show: composing (typing), recording (audio), paused, available, unavailable | |
| delay | No | How long to show the presence in milliseconds |
Implementation Reference
- src/tools/send-presence.ts:14-37 (handler)Handler function 'registerSendPresence' that registers the 'send_presence' tool. It builds a payload with number, presence, and optional delay, then calls the Evolution API POST /chat/sendPresence/{instanceName}.
export function registerSendPresence(server: McpServer, client: EvolutionClient): void { server.registerTool( "send_presence", { title: "Send Presence", description: "Send a presence update (typing, recording, etc.) to a chat via the pinned instance.", inputSchema: schema, }, async (args) => { try { const payload: Record<string, unknown> = { number: args.number, presence: args.presence, }; if (args.delay !== undefined) payload["delay"] = args.delay; const data = await client.post(`/chat/sendPresence/${client.instanceName}`, payload); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); } - src/tools/send-presence.ts:7-12 (schema)Input schema for the 'send_presence' tool: number (PhoneOrJidSchema), presence (enum: composing/recording/paused/available/unavailable), and optional delay (non-negative integer).
const schema = { number: PhoneOrJidSchema, presence: z.enum(["composing", "recording", "paused", "available", "unavailable"]) .describe("Presence status to show: composing (typing), recording (audio), paused, available, unavailable"), delay: z.number().int().nonnegative().optional().describe("How long to show the presence in milliseconds"), }; - src/tools/index.ts:105-105 (registration)Registration call for send_presence tool in the tools index, under the 'Chat' section.
registerSendPresence(server, client); - src/tools/index.ts:32-32 (registration)Import statement for registerSendPresence from the send-presence module.
import { registerSendPresence } from "./send-presence.js";