Search Emails
search_emailsSearch emails by sender, recipient, subject, body, date, size, status, or attachment across one or multiple folders.
Instructions
Search emails by sender, recipient (To/CC/BCC), subject, body content, date range (received or sent), size, read/replied/starred/draft status, or attachment presence. Searches are server-side IMAP SEARCH except hasAttachment which filters locally. Use folder for a single folder or folders for multiple (pass ["*"] to search all). Returns summary fields. Use get_email_by_id for full content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Single folder to search (ignored if `folders` is set) | INBOX |
| folders | No | Search multiple folders. Use ["*"] to search all folders (capped at 20). Overrides `folder`. | |
| from | No | Filter by sender address or name | |
| to | No | Filter by recipient address | |
| subject | No | Filter by subject text | |
| hasAttachment | No | ||
| isRead | No | ||
| isStarred | No | ||
| dateFrom | No | ISO 8601 start date (INTERNALDATE — when received by server) | |
| dateTo | No | ISO 8601 end date (INTERNALDATE — when received by server) | |
| limit | No | Max results (1-200, default 50) | |
| body | No | Search within email body content | |
| text | No | Search headers and body (full text) | |
| bcc | No | Filter by BCC recipient | |
| answered | No | Filter by whether email has been replied to | |
| isDraft | No | Filter by draft status | |
| larger | No | Minimum email size in bytes | |
| smaller | No | Maximum email size in bytes | |
| sentBefore | No | Filter by Date: header before this date (ISO 8601) | |
| sentSince | No | Filter by Date: header since this date (ISO 8601) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emails | Yes | ||
| count | Yes | ||
| folder | Yes |