search_and_fetch_emails
Search your email inbox using filters and fetch the full content of specific emails, downloading attachments to your project folder.
Instructions
Searches the user's live email inbox. By default, searches only the Inbox folder (matching what the user sees in their mail client) — this excludes deleted items, drafts, and spam. Use filters to find specific emails (e.g., 'is_unread=True' for new emails, 'days_ago=7' for last week, 'folder=sent' for sent items, 'folder=all' to search the entire mailbox including trash). It returns a list of lightweight email previews. To read the full email body, thread history, and automatically download attachments to local disk, call this tool again and provide the specific email_id. Emails often contain attachments. It is highly recommended to always provide the working_directory parameter so attachments are saved directly to the user's actual project folder. This directory path refers to the user's native operating system, not the LLM's sandbox environment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sender | No | Filter by the sender's email address or name. | |
| subject | No | Filter by keywords in the subject line. | |
| has_attachments | No | If True, only returns emails that contain file attachments. | |
| attachment_name | No | Filter by a specific attachment filename. | |
| is_unread | No | If True, returns ONLY unread emails. If False, returns ONLY read emails. Leave empty for both. | |
| days_ago | No | Filter emails received in the last N days (e.g., 7 for last week). | |
| folder | No | The mailbox folder to search in. Defaults to 'inbox' when omitted, which matches what the user sees in their mail client and excludes deleted items, drafts, and spam. Use 'sent' to search sent items. Use 'all' ONLY when the user explicitly asks to search across the entire mailbox including trash/deleted items. | |
| limit | No | Maximum number of emails to retrieve (default: 10). | |
| offset | No | Pagination offset to skip the first N emails. | |
| email_id | No | If provided, fetches the exact full email and downloads its attachments. Accepts short IDs from search results (e.g., 'msg_abc123') OR direct Adeu IDs (e.g., 'adeu_4052'). | |
| working_directory | No | Optional. The current working directory of the project or task. If provided, attachments will be saved here under an 'adeu_attachments' subfolder. If omitted, attachments are saved to the system temp directory. |