List emails
search_emailsSearch and list mailbox emails using typed filters like sender, date, read status, and attachments, returning metadata and optional previews. Narrow results by folder and paginate to find messages fast.
Instructions
List or search emails in a mailbox, with metadata and optional previews. Filter with query, which takes typed search such as from:ann@example.com is:unread after:2026-01-01, and use folder for custom folders and labels. Paginate with pageToken. Use get_email for full bodies.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Typed search. Plain words search the message text; quote a phrase or a value that has spaces. Filters: from:, to:, subject:, in:inbox|sent|drafts|archive|spam|trash|all, is:read, is:unread, is:starred, is:unstarred, has:attachment, -has:attachment, after:YYYY-MM-DD (inclusive) and before:YYYY-MM-DD (exclusive), in UTC. Terms combine with AND; OR and parentheses are searched as text. | |
| 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. | |
| 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 | |
| includeSnippet | No | Request or suppress message previews. Gmail and Outlook include them unless this is false. IMAP mailboxes include them only when this is true. | |
| rawProviderQuery | No | Provider-native Gmail syntax or Outlook KQL for one compatible account | |
| includeSearchContext | No | Include a match-centered body excerpt; requires search words in query |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |