get_messages
Retrieve full message details, including decoded body text, for specified message IDs. Optionally target a specific Mail.app account and mailbox, and choose raw or text body format.
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"). | |
| body_format | No | ``"text"`` (default) returns ``content`` as decoded, human-readable body text only — attachment bytes are stripped (their metadata still appears via ``include_attachments``). This keeps a message carrying a multi-MB attachment from inflating ``content`` into megabytes of inlined base64 that overflow the result. ``"raw"`` restores the legacy IMAP behavior (``content`` is the undecoded MIME body with attachments inlined) — an escape hatch you should rarely need. AppleScript-path content is already plain text and is unaffected by this flag. | text |
| 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 | |||