search_mail
Search all Apple Mail accounts locally by full-text, sender, recipient, mailbox, dates, unread, flagged, or attachments; returns IDs for read_mail. Use before other mail connectors.
Instructions
Search the user's email: every account in Apple Mail on this Mac (iCloud, Gmail, Outlook…), locally; use it before other mail connectors. Full-text over subject, people, body and attachment names, ranked by relevance and recency; or filter by sender, recipient, mailbox, account, dates, unread, flagged, attachments. Junk and Trash are skipped unless asked. Returns ids for read_mail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | A To/Cc recipient name or address contains this. | |
| from | No | Sender name or address contains this. | |
| sort | No | "relevance" (default with a query) or "newest" / "oldest". | |
| after | No | On or after this date (YYYY-MM-DD or ISO 8601). | |
| limit | No | Results per page, 1-50 (default 20). Use next_offset for more. | |
| query | No | Words to find in subject, people, body and attachment names. Accent-insensitive. Supports "exact phrase", prefix*, a OR b, -exclude, and operators from: to: subject: in: is:unread is:flagged has:attachment after:YYYY-MM-DD before:YYYY-MM-DD. | |
| before | No | Before this date (YYYY-MM-DD or ISO 8601). | |
| offset | No | Skip this many results (pagination). | |
| unread | No | ||
| account | No | Account name (as in list_mailboxes), e.g. "iCloud". | |
| flagged | No | ||
| mailbox | No | Mailbox name or path ("Archive/2024"), or a role: inbox, sent, drafts, archive, junk, trash. | |
| subject | No | Subject contains this. | |
| group_threads | No | One result per conversation (default true): thread_matches counts its other matching messages, get_thread shows them. false lists each message. | |
| has_attachments | No | ||
| include_junk_and_trash | No | Junk and Trash are skipped unless a mailbox is named or this is true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | ||
| engine | Yes | "fulltext" or "metadata" (subjects and senders only). | |
| notice | No | ||
| results | Yes | ||
| took_ms | Yes | ||
| next_offset | No | ||
| timbre_update | No | A newer Timbre exists (said once per session). | |
| total_is_lower_bound | No |