Search messages
mail_search_emailsSearch emails by text, sender, recipient, subject, folder, date, unread, or attachments, or list a thread. Returns message IDs, thread, sender, date, and preview, newest first with paging.
Instructions
Searches mail (full text, sender, recipient, subject, folder, date, unread, attachments) or lists a whole thread. Returns message ids (for mail_get_email), thread, sender, date and a preview. Newest first, paging through limit/offset. Without a filter it returns the latest messages from all folders (trash included) — for “what is new” use mailbox="inbox", unread=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Recipient (part of the name or address). | |
| from | No | Sender (part of the name or address). | |
| text | No | Full text across subject, body and headers. | |
| after | No | Only messages received from this date on (YYYY-MM-DD or ISO 8601). | |
| limit | No | How many messages to return (1–100). | |
| before | No | Only messages received up to this date (YYYY-MM-DD or ISO 8601). | |
| offset | No | How many messages to skip (paging). | |
| unread | No | true = unread only. | |
| account | No | Which account: leave empty for the signed-in mailbox, or name a shared mailbox / group you have access to (the part before @ is enough; a full address works too). mail_list_mailboxes shows what exists. | |
| mailbox | No | Folder: inbox, sent, drafts, trash, junk, archive, or a folder name. | |
| subject | No | Part of the subject. | |
| thread_id | No | List every message of this thread (threadId from an earlier result); other filters are then ignored. | |
| has_attachment | No | true = only messages with an attachment. |