Read Email
email_readRead, list, and search emails in one inbox, using pagination offsets to retrieve complete results and truncated body continuations.
Instructions
Read, list and search email in one inbox. list and search return a single page: when the response says has_more, call again with the returned next_offset and otherwise identical arguments. Only has_more: false means you have seen everything. Long bodies are windowed the same way: body_truncated means read again with body_next_offset as body_offset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Cc recipient to match: address, name, or fragment. | |
| to | No | To recipient to match: address, name, or fragment. | |
| body | No | Text to find in the body. On Gmail this matches the whole message. | |
| from | No | Sender to match: address, name, or fragment. | |
| text | No | Text to match anywhere, headers included. | |
| inbox | No | Inbox email address; an alternative to inbox_id, which wins when both are given. | |
| limit | No | Message summaries per page. Prefer paginating over a large limit. | |
| query | No | Provider-native raw query (escape hatch); prefer the structured fields. Ignored on Fastmail. | |
| since | No | Received on or after this date or datetime (no timezone = UTC). | |
| action | Yes | Operation to run. list = recent messages, optionally by folder or unread; read = full content of one message_id; read_batch = up to 50 message_ids, bodies windowed tighter than read; search = structured filters (from/to/subject/body/since/before/unread/has_attachment/flagged); attachment = download one attachment by attachment_index or filename, base64; extract = readable text from one attachment, without its bytes; original = the whole stored message as an .eml resource. | |
| before | No | Received strictly before this date or datetime (no timezone = UTC). | |
| folder | No | Folder to list, case-sensitive: 'INBOX', 'SENT', 'DRAFTS', 'TRASH', or provider-specific such as '[Gmail]/Spam'. | INBOX |
| offset | No | Zero-based page offset. Pass the previous response's next_offset exactly; a short page is not proof of the end. Newest first. | |
| unread | No | true = unread only; false = read only; omit for both. | |
| flagged | No | true = only flagged/starred messages. Ignored on Outlook. | |
| subject | No | Text to match in the subject; phrases match as-is. | |
| filename | No | Exact attachment filename, case-insensitive. Ignored when `attachment_index` is given. | |
| inbox_id | No | Inbox UUID. Optional when the key has exactly one inbox. Otherwise pass this or `inbox`; omit both and the error lists every inbox_id. | |
| message_id | No | Provider-native message id, from a previous list or search. | |
| body_offset | No | Start of the plain-text window. Pass back body_next_offset to continue a truncated body. | |
| message_ids | No | Message ids to read. Duplicates are removed, first occurrence kept. | |
| unread_only | No | Return only unread messages. | |
| include_html | No | Also return the sanitized HTML body. Worth it only when you need the formatting or structure. | |
| mark_as_read | No | Mark the message read at the provider after fetching it. | |
| body_max_chars | No | Body chars per message. Default 8000 here, 2000 on read_batch. 0 returns headers only. | |
| has_attachment | No | true = only messages with an attachment. Ignored on generic IMAP. | |
| include_folders | No | Folders to search. IMAP covers INBOX only unless you name archive or sent folders; Gmail always searches everything. | |
| attachment_index | No | 0-based position in the `attachments` list from action: read. Wins over `filename`. | |
| body_html_offset | No | The same for body_html: pass back body_html_next_offset. | |
| include_attachments | No | Inline attachment bytes as base64, sharing one 10 MB budget. Files over 2 MB are NOT inlined; they return metadata with a `note`. Metadata (filename, mime_type, size_bytes, attachment_index) always comes back anyway, so prefer false, then fetch the one file you need with action: attachment by its attachment_index (up to 25 MB). |