Search emails (one or many accounts)
search_emailsSearch emails across all connected Gmail and IMAP accounts using query syntax, merging results newest-first with each tagged by account.
Instructions
Search mail with Gmail query syntax (from:, to:, subject:, is:unread, has:attachment, after:2026/10/01, newer_than:7d, label:, in:inbox ...). Searches ALL connected accounts by default and merges the results newest-first, each tagged with its account; the same email found in several accounts is shown once (see "alsoIn"). Pass "account" to narrow it. Returns headers + snippet; use read_email for the full body. IMAP accounts support the common operators.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query, e.g. "is:unread newer_than:2d" or "from:dhl.com has:attachment". Use "" for latest mail. | |
| account | No | Which mailbox(es): an alias, an email address, a list of them, or "all". Omit to use ALL connected accounts. No accounts connected yet. | |
| pageToken | No | Continue a previous single-account search (from nextPageTokens). | |
| maxResults | No | Max results PER ACCOUNT (default 10). | |
| includeSpamTrash | No | Also search Spam and Trash (default false). |