search_emails
Search connected mailboxes. Results are compact summaries; use get_email to read a message. To search one folder, supply its mailbox accountId with folderId. Returns indexed results immediately while mailbox searches continue in the background. pendingAccountIds identifies mailboxes still searching; semanticPending:true means semantic results are not ready yet, even when messages is empty and nextCursor is absent. If semanticPending is true, retry the identical query and filters once after about 500 ms, preserving accountId, folderId, and limit, omitting cursor, and setting waitForFresh:false. Check semanticPending on the follow-up; if it remains true, treat results as incomplete rather than as no matches. This is independent of provider freshness and pendingAccountIds. failures identifies settled errors. Repeat the same query and filters without a cursor, with waitForFresh:false, to obtain accumulated results. nextCursor paginates existing results. Stale or pending results are not proof that a mailbox is empty. Set waitForFresh to wait briefly for a provider update.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| sort | No | Text searches default to relevance. Inbox and folder lists default to newest first. Choose relevance, newest first, or oldest first explicitly. | |
| after | No | ||
| limit | No | ||
| query | No | ||
| before | No | ||
| cursor | No | ||
| isRead | No | ||
| subject | No | ||
| folderId | No | Opaque folder ID from list_mail_folders. Requires the same accountId because folders belong to one mailbox. | |
| accountId | No | ||
| isStarred | No | ||
| maxWaitMs | No | Maximum refresh wait in milliseconds (up to 15000). At the deadline, a cached copy may be returned with freshness metadata; this is not a guarantee of a fresh response. | |
| waitForFresh | No | Wait briefly for a provider refresh instead of immediately returning a cached copy. Check the returned freshness timestamps and stale/refreshing flags. | |
| hasAttachments | No |