Get an attachment
get_attachmentDownload a specific email attachment by message ID and part ID or filename to read text and PDF content, view supported images, or save other files to disk.
Instructions
Download one attachment of a message and return its contents. Text files and PDFs with a text layer come back as text, PNG/JPEG/GIF/WebP images (up to 5 MB) as an image you can see; any other file, and a scanned PDF, is saved under ~/.multi-mail/attachments and its path is returned with a note. Use it after read_email when the user needs what an attached invoice, report or photo says. Pick the file by part_id from read_email's attachment list, or by filename; a message with a single attachment needs neither. Returns an error listing the attachments if none matches. Does not change the mailbox.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | Also save the file under ~/.multi-mail/attachments. | |
| account | No | Which mailbox: email address, alias, or local part. Optional when only one account is connected. | |
| part_id | No | partId from the attachments list of read_email. | |
| filename | No | Attachment file name, when part_id is not known. | |
| max_chars | No | Longest text to return for text and PDF files (default 50,000); longer text is cut and marked. | |
| message_id | Yes | Message id from search_emails or read_email. |