search_messages
Search emails by subject, sender, or message content, then narrow results using date, mailbox, and account filters for faster retrieval.
Instructions
Search messages by subject, sender, or content. Prefer 'subject' or 'sender' fields which are fast metadata lookups. The 'content' field searches message bodies and is significantly slower and less reliable — it may trigger full message downloads on IMAP accounts and can time out. WARNING: Mail.app loads all matching messages into memory before applying the limit, so searches on large mailboxes can be very slow. Always narrow results with mailboxName and accountName when possible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Only return messages received after this ISO 8601 date (e.g. 2024-01-15T00:00:00Z) | |
| field | Yes | The field to search in | |
| limit | No | Maximum number of results to return (default 50) | |
| query | No | The search query string (optional when using date filters) | |
| before | No | Only return messages received before this ISO 8601 date (e.g. 2024-12-31T23:59:59Z) | |
| accountName | No | Limit search to a specific account (omit to search all accounts) | |
| mailboxName | No | Limit search to a specific mailbox (omit to search all mailboxes) |