Wait for new WhatsApp messages
wait_for_messagesWait for new messages within a timeout, using a cursor to avoid missing messages between calls. Optionally filter for direct messages, mentions, and replies addressed to you.
Instructions
Wait for messages from other people, up to timeout_seconds, and return them with a cursor: pass it to the next call so nothing that lands between calls is missed. addressed_to_me wakes only for direct messages, mentions and replies to the user. For agents that stay on the line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | From the previous call | |
| chat_id | No | Chat id, or a phone number | |
| account_id | No | Account id | |
| addressed_to_me | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| cursor | Yes | Pass to the next call | |
| messages | Yes | ||
| timed_out | Yes | ||
| account_id | Yes | ||
| cursor_reset | Yes | The cursor was from another run; the wait started now |