mail_attachments
List attachments on Apple Mail messages by scanning a mailbox or targeting one message by ID, so you can confirm files landed on a draft or find where an attachment was received.
Instructions
List attachments on messages in a Mail mailbox, or on ONE message (Automation).
mailbox: the folder value from a mail_search result passed back VERBATIM (an
opaque imap://<uuid>/<path> token, not a name to retype), or a canonical system
mailbox — "inbox" | "sent" | "drafts" | "trash" | "junk" (resolved via Mail's
unified, cross-account accessors). query: optional
subject substring — an empty/omitted query lists ALL messages in the mailbox
(bounded), unlike mail/get_pointers which rejects an empty query. Use this to
confirm an attachment landed on a DRAFT before it's saved (a freshly opened compose
window has no stable id yet — once saved to Drafts it does, see drafts()).
message_id: address ONE message instead of scanning; with no mailbox the id
resolves on its own (Full Disk Access), and query is then ignored. Prefer it when
you know the message — a mailbox scan stops at 25 records, so the one you meant is
often past the cap. Either mailbox or message_id is required.
Returns {results, truncated?} over
[{id, deeplink, folder, summary, attachments: [{name, size, downloaded}]}].
id/deeplink identify the carrying message and folder names the mailbox read,
so a row is actionable on its own. An unsaved draft has no message-id yet:
its id is "" and it carries no deeplink — it is still listed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| mailbox | No | ||
| message_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||