Wait for new WhatsApp messages
wait_for_messagesWait for incoming WhatsApp messages up to a timeout and return them with a cursor, so agents can process new messages without gaps; filter to direct messages, mentions, and replies.
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 | ||
| 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 |