get_messages
Retrieve full details and body content of specific email messages by ID or from the current selection in Apple Mail. Supports filtering to headers only or including attachments.
Instructions
Get full details of one or more messages, with bodies.
Returns a list of message dicts (possibly of length 0 or 1). Pair with
search_messages (metadata-only) and get_thread (thread member
ids) to fetch bodies for specific messages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Mail.app account name. Together with ``mailbox``, activates the IMAP fast path for explicit ids: one round-trip lookup instead of an account×mailbox AppleScript scan (issue #72). Ignored for the ``"SELECTED"`` sentinel (selection is global). | |
| mailbox | No | Folder to look in for the IMAP fast path (e.g. "INBOX"). | |
| message_ids | Yes | List of message ids to fetch. May include the literal token ``"SELECTED"``, which the server resolves at call time to Mail.app's current UI selection (zero-or-more messages). Mixed lists like ``["SELECTED", "12345"]`` are valid. Empty list is a no-op (returns empty result, no error). Missing ids drop out silently (partial-results convention) — the response contains whatever was found. | |
| headers_only | No | Skip body fetch on the IMAP path for explicit ids (default: False). Silently ignored on the AppleScript fallback. | |
| include_content | No | Include message bodies (default: True). | |
| include_attachments | No | Include per-attachment metadata (name, mime_type, size, downloaded) on each message (default: True). Bounded cost — id-list cardinality is typically 1-10. Free on the IMAP fast path; cheap-enough on the AppleScript fallback for typical id counts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||