Wait for new WhatsApp messages
wait_for_messagesBlocks until a WhatsApp message arrives, returns it or empty on timeout, so agents receive messages without polling while using a cursor to avoid gaps.
Instructions
Block until a message arrives, then return it, or return empty when the timeout passes. This is how an agent stays on the line without polling: call it in a loop, and pass the cursor it returns into the next call so nothing that landed between two calls is missed. The first matching message starts a one-second settle so a burst comes back together.
Only messages from other people are returned, never the user's own, and never WhatsApp's system notices. With addressed_to_me, only direct messages, group messages that @-mention the user, and replies to the user's own messages wake the wait; everything else in a group is ignored. A cursor from a previous run of wazap cannot be honoured: the wait then starts from now and says cursor_reset.
The timeout is capped at 55 seconds because MCP clients give up at 60.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | The cursor returned by the previous call | |
| chat_id | No | Only messages in this chat | |
| account_id | No | Registry account id (default, work, …). Omit to resolve from chat_id or message_id, or the default account. | |
| addressed_to_me | No | Only direct messages, @-mentions of the user and replies to the user's messages | |
| timeout_seconds | No | How long to wait (1-55 s) |