download_attachment can often be called directly from the search result. Fetch a full message with get_email when you need recipients or the complete body.
Parameters
string
Free-text search over subject, body, and addresses. 1–500 characters. Terms are matched independently and combined with OR — a message matches if it contains any of the terms — and messages matching more terms rank first, with each hit showing a
matched: X/N terms line. Wrap a phrase in double quotes ("Google Workspace") to require all its words in the same field, rather than any one of them anywhere. To narrow a search, combine query with the structured filters (from, keywords, after/before) instead of adding more terms; only the first 10 terms are used.string
Only messages received on or after this UTC ISO 8601 timestamp, e.g.
2026-04-01T00:00:00Z.This filters the received date, not any date the message talks about. A confirmation arrives before the event
it confirms, so for an event-anchored request (“yesterday’s show”, “last week’s flight”) start the window a
booking lead time — days to weeks — before the event rather than on the event day. Paired with an email-type
filter, a wide window no longer drowns the target in newsletter noise.string
Only messages received strictly before this UTC ISO 8601 timestamp, e.g.
2026-07-01T00:00:00Z. Also the received
date: for an event-anchored request, end the window at the event rather than bounding it to the event day.string
Substring match on the sender’s name or address. 1–200 characters.
string[]
Filter by the classified email type; multiple values combine with OR. At least one
value when present. Valid values:
Every value except
todo is a classified email type, and each message carries exactly one of them: receipt
returns receipts and not orders. todo is a flag orthogonal to the taxonomy, so it combines with any type.Messages analyzed before classification existed carry no type. If a type filter returns nothing, fall back to a
free-text query.string
Restrict to a named mailbox/folder, e.g.
Inbox.The standard places — Inbox, Sent, Archive, Drafts, Trash, Junk — are resolved to the folder
holding that special-use role, so they match whatever
the server actually names it (Sent finds a mailbox called Sent Items). Any other value matches a folder
name exactly, and a place name falls back to a name match when no folder carries the role.integer
default:"20"
Maximum results, 1–100.
Example
Call
Result
Call
tags: line. Messages with no preview omit the snippet: line. Hits from a multi-term query carry a matched: X/N terms line and are ordered by that count (newest-first within equal counts); single-term and filter-only results are newest-first. Hits carrying files list non-inline attachments with filename, media type, size, and blobId; if the server reports attachments but no non-inline parts are available, the hit falls back to attachments: yes. An empty result returns No messages matched. When the result filled limit, it ends with a truncation note — more matches may exist beyond the page (and for multi-term queries, match counts are computed within a newest-first window per term), so narrow the date range or raise limit.
Errors
Provide at least one filter: query, after, before, from, keywords, or mailbox.— the call had no filter.query contains no searchable terms.— thequeryvalue was only whitespace or empty quotes.Mailbox not found: <name>. Available folders: ...— themailboxvalue matched neither a folder name nor a special-use role. The listed folder names say what to ask for instead.