wait_for_mailbox_changes
Detect mailbox changes in real time by opening an IMAP IDLE session and blocking until an update occurs or the timeout expires. Returns whether a change was observed, eliminating the need for polling.
Instructions
Open an IMAP IDLE session and block until a mailbox change event arrives or the timeout expires. Use to detect real-time inbox activity without polling. Returns whether a change was observed. Always returns within timeoutSeconds plus a few seconds' grace, even if the underlying IDLE session gets stuck — do not use in fire-and-forget pipelines. A change that arrives may not always wake the call early; it is still detected and reported correctly, just not necessarily before the timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Mailbox to watch during IDLE. | INBOX |
| timeoutSeconds | No | Maximum watch duration in seconds. |