The MCP endpoint exposes 7 tools that an AI agent or MCP-compatible client can discover viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jihvijhojhviihogyuvi/whatsapp-api/llms.txt
Use this file to discover all available pages before exploring further.
tools/list and invoke via tools/call. Each tool is called by posting a JSON-RPC 2.0 request to POST http://127.0.0.1:8790/mcp with method: "tools/call" and a params object containing the tool name and its arguments. All tool responses are wrapped in a content array — parse the text field of the first element to get the structured JSON result. The text value is always a pretty-printed JSON string (JSON.stringify(payload, null, 2)).
whatsapp_status
Check WhatsApp Web auth and local Chrome session status. This is a lightweight, read-only probe — it does not open Chrome or start any auth flow. Use it to inspect the current session state before deciding whether to callwhatsapp_start_auth or whatsapp_pairing_code.
No input parameters.
Request
text JSON)
Current client lifecycle state. One of:
stopped, starting, qr, authenticated, ready, auth_failure, disconnected.true when the WhatsApp Web session is fully established and ready to send/receive.Mirrors
ready. true once the session has passed authentication.Filesystem path where the local WhatsApp Web session credentials are stored.
Path to the Chrome binary being used by Puppeteer.
Whether Chrome is running in headless mode (
WHATSAPP_HEADLESS=true).true if a QR code is currently available at GET /qr for scanning.Last error message from an
auth_failure or disconnected event, or null.Account info when
ready: true, otherwise null. Contains wid (serialized WhatsApp ID), pushname (display name), and platform.whatsapp_start_auth
Open Chrome and start WhatsApp Web authentication if needed. Calling this tool launches a Chrome window (or headless browser process) and begins the WhatsApp Web login flow. If the session is already authenticated, the existing status is returned immediately without re-launching Chrome. A QR code will appear in the Chrome window — scan it with WhatsApp on your phone to complete authentication. No input parameters. RequestThe response reflects the state at the moment the call returns. Chrome may still be initializing —
state will transition from starting → qr → authenticated → ready as the flow progresses. Poll whatsapp_status to watch for ready: true.whatsapp_pairing_code
Generate a WhatsApp Linked Devices phone-number pairing code for this API session. Instead of scanning a QR code, you can link your phone by number. This tool requests a pairing code from WhatsApp for the given phone number. Enter the returned code in WhatsApp under Settings → Linked Devices → Link a Device → Link with phone number instead. Input parametersPhone number with country code. Accepts raw digits or E.164 format (e.g.,
"15551234567" or "+15551234567"). Non-digit characters are stripped automatically. Must be 8–15 digits.text JSON)
true if the session is already ready — no pairing code was generated.Normalized phone number (digits only) that the code was generated for.
The pairing code to enter in WhatsApp.
null when already_authenticated is true.Human-readable instructions for completing the pairing flow.
Present only when
already_authenticated: true. Full status object (same shape as whatsapp_status).whatsapp_send_message
Send a WhatsApp text message through the authenticated WhatsApp Web session. The phone number is normalized to digits and formatted as a WhatsApp chat ID (<digits>@c.us) before sending. If the session is not yet ready, the tool will wait up to 120 seconds for it to become ready before throwing an error.
Input parameters
Recipient phone number with country code. Accepts raw digits or E.164 format (e.g.,
"15551234567"). Must be 8–15 digits after stripping non-digit characters.Text content of the message to send. Must be a non-empty string.
text JSON)
true on success.Normalized recipient phone number (digits only).
Full WhatsApp chat ID used internally (
<phone>@c.us).Serialized ID of the sent message as returned by WhatsApp Web.
ISO 8601 timestamp of when the message was sent.
whatsapp_list_chats
List recent WhatsApp chats for the authenticated WhatsApp Web session. Returns chats sorted by most-recent activity first. Each entry includes metadata about the chat and an optional summary of the last message. Useful for an agent to discover which conversations exist before reading specific threads. Input parametersMaximum number of chats to return. Must be between
1 and 100. Defaults to 20.text JSON)
true on success.Number of chats returned (may be less than
limit if fewer chats exist).Array of chat summary objects, each with the following fields:
Serialized WhatsApp chat ID (e.g.,
15551234567@c.us or groupid@g.us).Display name of the contact or group.
true for group chats.true if the chat cannot be replied to.Number of unread messages in the chat.
Unix timestamp of the most recent message activity.
true if the chat is archived.true if the chat is pinned.true if notifications for this chat are muted.Summary of the most recent message (same shape as message objects in
whatsapp_read_messages), or null.whatsapp_read_messages
Read the last messages from a phone-number chat. Fetches up tolimit recent messages from the 1-on-1 chat identified by the given phone number. Messages are returned in chronological order as provided by WhatsApp Web.
Input parameters
Phone number of the chat to read. Must include country code (e.g.,
"15551234567"). Accepts digits or E.164 format.Maximum number of messages to fetch. Must be between
1 and 100. Defaults to 10.text JSON)
true on success.Chat summary for the requested phone number (same shape as entries in
whatsapp_list_chats).Number of messages returned.
Array of message objects, each with:
Serialized message ID.
Sender WhatsApp ID (e.g.,
15551234567@c.us).Recipient WhatsApp ID.
Author field (populated in group chats).
true if this message was sent by the authenticated account.WhatsApp message type (e.g.,
"chat" for text, "image", "audio", etc.).Text content of the message. Empty string for non-text message types.
Unix timestamp of when the message was sent.
true if the message contains an attachment (image, video, document, etc.).whatsapp_logout
Logout WhatsApp Web for this local session. Callslogout() and destroy() on the WhatsApp Web client, clears all in-memory session state, and resets the client to stopped. The persisted auth directory (.wwebjs_auth) is not deleted — to fully remove the session, delete that directory manually.
No input parameters.
Request
text JSON)
true when logout and client destruction completed successfully.