get_attachment
Get one attachment of a message. Give it the message id (from search_messages or get_message) and the attachment's position in that message's attachments list, where 0 is the first attachment. By default it returns metadata plus a signed download URL good for 5 minutes, up to 10MB. Pass inline: true to get the file's bytes as content_base64 in this result instead, up to 5MB - use that when you cannot open URLs on this server, for example in a sandbox with restricted network access. Only reads mail; it never changes the mailbox.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inline | No | true returns the file's bytes as content_base64 instead of a download URL. Recommended when your environment cannot reach URLs on this server. Default false. | |
| message_id | Yes | The message id from search_messages or get_message. | |
| attachment_index | Yes | Position (0-based) in that message's attachments list. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Short-lived download link; present unless inline was requested | |
| size | Yes | Size in bytes | |
| filename | Yes | File name | |
| message_id | Yes | Message the attachment belongs to | |
| content_type | Yes | MIME type | |
| content_base64 | No | Base64 file content; present only with inline | |
| attachment_index | Yes | Position in the message's attachments | |
| expires_in_seconds | No | Seconds the download link stays valid |