search_emails
Search emails using a portable query syntax with filters for sender, recipient, subject, date, folder, read status, attachment presence, and more.
Instructions
Search one account with typed portable syntax. The query supports text, from:, to:, subject:, in:, read and starred states, attachments, and date filters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| read | No | ||
| after | No | YYYY-MM-DD received date, inclusive in UTC | |
| query | Yes | Typed portable search syntax | |
| before | No | YYYY-MM-DD received date, exclusive in UTC | |
| folder | No | Folder role (inbox, sent, drafts, trash, spam, starred, archive, all) or a label/folder name. Use all or omit this field to search all mail except Spam and Trash. An IMAP server's \All mailbox may use different rules. | |
| starred | No | ||
| subject | No | ||
| pageSize | No | Defaults to 25 | |
| accountId | No | Account to operate on. Optional when exactly one account is connected. | |
| pageToken | No | nextPageToken from a previous call | |
| hasAttachment | No | ||
| rawProviderQuery | No | Provider-native Gmail syntax or Outlook KQL for one compatible account |