search_emails
Search emails in any folder using IMAP queries. Filter by sender, subject, date, or read status, and paginate results for efficient retrieval.
Instructions
Search emails in a folder.
IDs returned are IMAP UIDs (stable within a folder's UIDVALIDITY), not sequence numbers — they will not change after other messages are deleted.
Args: folder: Mailbox folder (default: INBOX). Use list_folders() to see available folders. Accepts either ASCII names, raw IMAP names from list_folders(), or human-readable non-ASCII names (e.g. "Корзина") — the latter are auto-encoded to IMAP modified UTF-7. query: IMAP search query. Examples: - "ALL" - all emails - "UNSEEN" - unread emails - "FROM sender@example.com" - from specific sender - "SUBJECT hello" - subject contains "hello" - "SINCE 01-Dec-2024" - emails since date - "BEFORE 31-Dec-2024" - emails before date - Can combine: "UNSEEN FROM boss@company.com" limit: Maximum number of emails to return (default: 20) offset: Number of newest-first results to skip, for pagination (default: 0)
Returns list of email summaries with id (UID), subject, from, date.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | INBOX | |
| query | No | ALL | |
| limit | No | ||
| offset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |