Gmail Attachment Download
download_gmail_attachmentRetrieve a specific attachment from a Gmail message. Get a temporary download URL, save to disk, or receive base64 content.
Instructions
Download a specific attachment from a Gmail message. By default returns a temporary signed download URL (15 min, one-time use). Set return_url=false to save to disk, or return_content=true for base64. First use get_gmail_message_content to list attachments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The attachment filename from get_gmail_message_content response | |
| save_dir | No | Directory to save the attachment to. Defaults to ~/Downloads. Only used when return_url and return_content are both false. | |
| message_id | Yes | The Gmail message ID that contains the attachment | |
| return_url | No | If true (default), return a temporary signed download URL (15 min, one-time use). Best for remote clients. Set to false to use save_dir or return_content instead. | |
| return_content | No | If true, return base64-encoded file content instead of saving to disk. Only used when return_url is false. | |
| user_google_email | No | Use 'me' or 'myself' for auto-resolution to authenticated user, or provide specific email address. If None, uses current authenticated user (auto-injected by middleware). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| size | No | ||
| error | No | ||
| success | Yes | ||
| filename | No | ||
| mimeType | No | ||
| file_path | No | ||
| userEmail | Yes | ||
| message_id | No | ||
| download_url | No | ||
| attachment_id | No |