Search Gmail
search_gmail_messagesSearch the user's connected Gmail mailboxes and return matching messages, newest first — from, to, subject, date, and a short snippet of the body. query uses Gmail search syntax: 'in:sent to:jane@acme.com' for messages the user sent to someone, 'from:jane@acme.com' for messages they received, plus operators like subject:, newer_than:7d, and has:attachment. So 'show me the last 5 messages I sent to jane@acme.com' is query 'in:sent to:jane@acme.com' with max_results 5. Each result carries a starred flag — a message the user starred matters to them, so weight it accordingly; 'is:starred' finds starred mail directly. For 'how many' questions, use total_matches_estimate in the result — it is Gmail's estimate of ALL matches, beyond the messages returned. If it reports no Gmail account connected, tell the user to connect one at /user/integrations. Rare header-only connections cannot run query search — the tool says so; answer correspondence questions from the brain for those.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search in Gmail query syntax, e.g. 'in:sent to:jane@acme.com newer_than:30d'. | |
| account | No | Email address of one connected mailbox to search. Omit to search all connected mailboxes. | |
| max_results | No | Max messages to return (default 10, max 100). |