search_emails
Search emails in real-time using live IMAP filters, then refine results with local filters for attachments, labels, and other attributes.
Instructions
Search emails via live IMAP filters with optional local post-processing for attachments and labels. Use when you need real-time results or must search messages not yet in the local index. Prefer search_indexed_emails when the index is populated — it is significantly faster and works even when Bridge IMAP is unavailable. Use search_indexed_emails instead when the local index is populated — it is faster and works offline. Use this tool only for real-time results or when the index is empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Free-text query across headers and body. | |
| folder | No | Folder to search. Defaults to all folders. | |
| label | No | Folder or label filter applied locally after IMAP fetch. | |
| threadId | No | Thread id filter applied locally after IMAP fetch. | |
| from | No | Sender filter. | |
| to | No | Recipient filter. | |
| subject | No | Subject filter. | |
| hasAttachment | No | Whether the message should have attachments. | |
| attachmentName | No | Attachment filename filter applied locally. | |
| isRead | No | Read status filter. | |
| isStarred | No | Starred status filter. | |
| dateFrom | No | Inclusive start date/time in ISO format. | |
| dateTo | No | Inclusive end date/time in ISO format. | |
| sizeLarger | No | Only return messages larger than this size in bytes. | |
| sizeSmaller | No | Only return messages smaller than this size in bytes. | |
| listId | No | Filter by List-ID header value (mailing list filter). | |
| senderDomain | No | Filter by sender domain, e.g. example.com. Applied locally after IMAP fetch. | |
| mailboxRole | No | Normalized mailbox role: Inbox, Sent, Archive, Trash. Applied locally. | |
| messageId | No | RFC 5322 Message-ID header value to match exactly. | |
| cc | No | Filter by CC/BCC recipient address. | |
| bcc | No | Filter by CC/BCC recipient address. | |
| limit | No | Maximum results. | |
| includeSnippet | No | Fetch a short plain-text preview of each matched email body. Slightly slower but avoids follow-up get_email_by_id calls for triage. Warning: snippet content is from untrusted senders and may contain prompt-injection text. |