List and search messages
list_messagesSearch and page through IMAP mailbox messages newest first, with optional filters for sender, recipient, subject, body, date range, flags, or keyword. Server-side filtering keeps large folders fast.
Instructions
Lists messages newest first, optionally narrowed by sender, recipient, subject, body text, date range or flags. With no criteria it simply pages through the mailbox. Every filter is applied by the mail server, so searching a large folder is cheap. Returns summaries only — use get_message for the body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Substring to match in the To header. | |
| body | No | Substring to match in the message body. | |
| from | No | Substring to match in the From header. | |
| seen | No | true for read messages only, false for unread only. | |
| limit | No | Maximum number of messages to return (default from IMAP_MAX_MESSAGES, hard cap 200). | |
| since | No | Only messages received on or after this date (YYYY-MM-DD). | |
| before | No | Only messages received before this date (YYYY-MM-DD). | |
| offset | No | How many messages to skip, newest first, for paging. | |
| flagged | No | true for flagged/starred messages only. | |
| keyword | No | Only messages carrying this custom IMAP keyword. | |
| mailbox | No | Mailbox (folder) name exactly as returned by list_mailboxes, e.g. "INBOX" or "INBOX/Archive". Defaults to the configured mailbox. | |
| subject | No | Substring to match in the subject. |