imap_get_attachment
Download a single email attachment to disk by MIME part ID or filename, returning the saved file path without loading large binaries into the response.
Instructions
Download one attachment to disk
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| part_id | No | MIME part id to fetch (e.g. `1.2`), as shown by `imap_get_message`. Takes precedence over `filename` when both are given. | |
| filename | No | Attachment filename to fetch (case-insensitive). Used when `part_id` is omitted. | |
| account_id | No | Account identifier (defaults to `"default"`) | default |
| message_id | Yes | Stable message identifier | |
| output_dir | No | Directory to save the attachment into. Overrides the server default (`MAIL_ATTACHMENT_DOWNLOAD_DIR`, else the system temp dir). | |
| include_base64 | No | Also return the raw bytes as base64 in the response, but only if the attachment is at most `max_inline_bytes`. Off by default to protect the context window. | |
| max_inline_bytes | No | Size ceiling (bytes) for inline base64. Ignored unless `include_base64` is `true`. Defaults to 262144 (256 KiB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Tool-specific data payload | |
| meta | Yes | Execution metadata (timestamp, duration) | |
| summary | Yes | Human-readable summary of the operation outcome |