search
Locate emails within a folder using sender, recipient, subject, body text, date range, or unread filter. Returns UID, date, sender, subject, size, and attachment flag, newest first.
Instructions
Search a folder (default INBOX) by from, to, subject, text, date range (since/before, YYYY-MM-DD) and unread state. Returns uid, date, from, subject, size and has_attachments, newest first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Substring of the To header. | |
| from | No | Substring of the From header. | |
| text | No | Substring anywhere in the headers or the body. | |
| limit | No | Most messages to return, newest first (default 20, at most 100). | |
| since | No | Received on or after this date (YYYY-MM-DD). | |
| before | No | Received before this date (YYYY-MM-DD). | |
| folder | No | Folder to search (default INBOX). Names as list_folders returns them. | |
| unseen | No | true: only unread messages; false: only read messages. | |
| subject | No | Substring of the subject. |