Get attachment
get_attachmentDownload an email attachment by account, UID, and part ID. Returns text or PDFs as text and other files as binary, or saves to disk when a directory is provided.
Instructions
Downloads one attachment (max 2097152 bytes into the conversation; with save_to up to 26214400 bytes to disk). Text-like types and PDFs with a text layer are returned as text, others as embedded binary. Pass save_to with a directory inside policy.attachment_dirs to write the file to disk instead; the result names the path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | uid from search_messages: a number on IMAP mailboxes, an id string on Outlook; pass it back exactly as returned | |
| part | Yes | part id from get_message | |
| folder | No | Folder/label path. Defaults to All Mail on Gmail, INBOX elsewhere. | |
| inline | No | Embed the binary content in the result instead of returning a link | |
| account | Yes | Account id from list_accounts | |
| save_to | No | Claude Desktop / Claude Code only: directory inside policy.attachment_dirs to write the file into; the tool returns the path |