Get attachment
get_attachmentDownload an email attachment by account, UID, and part; text and PDFs return as text, other files embed, or save to an allowed directory and get the path.
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 | |
| part | Yes | part id from get_message | |
| folder | No | Default: Gmail All Mail, else INBOX | |
| inline | No | Embed the bytes instead of a link | |
| account | Yes | list_accounts id | |
| save_to | No | stdio: folder in policy.attachment_dirs; returns the path |