Search messages
search_messagesSearch emails across multiple mail accounts using filters like sender, date, folder, read status, and full-text queries. Returns newest matches with identifiers for follow-up actions.
Instructions
Searches one account (or all accounts with account="all"). On Gmail, query accepts full Gmail search syntax (from:, newer_than:7d, has:attachment, label:, "exact phrase"). Elsewhere query is full-text and the structured filters do the rest. Returns newest first with uid + folder needed by other tools. On Outlook mailboxes total is the number of results returned, not a mailbox-wide count. On Outlook mailboxes from matches the exact address; use query for a partial match.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| limit | No | Default 20, max 50 | |
| query | No | Gmail search syntax on Gmail; plain text elsewhere | |
| since | No | ISO date, e.g. 2026-09-01 | |
| before | No | ISO date | |
| folder | No | Folder/label path. Defaults to All Mail on Gmail, INBOX elsewhere. | |
| offset | No | Skip this many hits; the window Graph and IMAP fetch grows with it, so keep it small | |
| unseen | No | Only unread | |
| account | Yes | Account id, or "all" to search every readable account | |
| flagged | No | Only starred/flagged | |
| subject | No | ||
| has_attachment | No |