fetch_emails
Fetch emails from any IMAP server. Search unread messages, filter by sender or subject, and retrieve from folders like Inbox or Sent.
Instructions
Fetch emails via IMAP. Works with Gmail, Outlook, Yahoo, iCloud, and any IMAP server.
For Gmail: use an App Password (not your regular password). Generate at: https://myaccount.google.com/apppasswords
For Outlook: enable IMAP in settings, use your regular password or app password.
Sample prompts that trigger this tool: - "Check my email: user@gmail.com password: xxxx-xxxx-xxxx-xxxx" - "Fetch unread emails from my Gmail" - "Search my inbox for emails about invoice" - "Get my latest 5 emails" - "Show emails from sender@example.com"
Args: email_address: Your email address. password: Password or app password (Gmail requires app password). imap_server: IMAP server hostname. Auto-detected for Gmail/Outlook/Yahoo if empty. folder: Mailbox folder. Default: INBOX. Common: INBOX, Sent, Drafts, Trash, Spam. search: IMAP search criteria. Default: UNSEEN (unread). Examples: ALL, SEEN, UNSEEN, FROM "sender@example.com", SUBJECT "keyword", SINCE "01-Jan-2024", BEFORE "01-Feb-2024". limit: Maximum number of emails to fetch. Default: 10.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| email_address | Yes | ||
| password | Yes | ||
| imap_server | No | ||
| folder | No | INBOX | |
| search | No | UNSEEN | |
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |