mail_find
Find exact email messages in Apple Mail's local database by sender, recipient, subject, or Message-ID and return matching copies as JSON. Excludes Trash by default.
Instructions
Exact email lookup in Mail's own database (not the semantic index, so it never waits on indexing and matches filters exactly). Returns JSON: one row per copy (the same Message-ID in INBOX and Sent is two rows) with message_id, subject, from, to, received, mailbox, account_id. Needs at least one of subject_prefix, subject_contains, from, to, message_ids. Trash is excluded unless include_trash or mailboxes asks for it. Pair with mail_trash message_ids to clear what it finds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Exact recipient address (To or Cc) | |
| from | No | Exact sender address | |
| limit | No | Maximum rows (default 50, max 500); 'truncated' says when more matched | |
| from_me | No | Only messages sent from one of your own addresses (any address that appears as a sender in a Sent mailbox) | |
| to_only | No | With to: that address is the only recipient | |
| mailboxes | No | Only these mailbox kinds (default: every mailbox except trash) | |
| message_ids | No | RFC822 Message-IDs (finds every copy) | |
| include_trash | No | Also return copies already in Trash (default false) | |
| received_after | No | ISO 8601 date/time; only messages received at or after it | |
| subject_prefix | No | Subject starts with this text (case-insensitive), e.g. '[Network] ' | |
| received_before | No | ISO 8601 date/time; only messages received before it | |
| older_than_hours | No | Only messages received more than this many hours ago | |
| subject_contains | No | Subject contains this text (case-insensitive) |