search_emails
Search a connected email account using portable query syntax to find messages by sender, recipient, subject, folder, read or starred state, attachments, or date range.
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 | ||
| includeSnippet | No | Request or suppress message previews | |
| rawProviderQuery | No | Provider-native Gmail syntax or Outlook KQL for one compatible account | |
| includeSearchContext | No | Include a match-centered body excerpt; requires a portable text query |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |