Get Gmail Attachment Content
get_gmail_attachment_contentDownload a Gmail attachment by providing its message ID and attachment ID, and receive a local file path or temporary download URL. Optionally return the attachment as base64 for direct use.
Instructions
Downloads an email attachment and saves it to local disk.
In stdio mode, returns the local file path for direct access. In HTTP mode, returns a temporary download URL (valid for 1 hour). May re-fetch message metadata to resolve filename and MIME type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | The ID of the Gmail message containing the attachment. | |
| attachment_id | Yes | The ID of the attachment to download. | |
| return_base64 | No | When True, includes the full attachment as a standard base64 string in the response (in addition to any file path or download URL). Useful for sandboxed clients that cannot reach localhost download URLs or the MCP server's local file paths (e.g. containerized agents with network allowlists). The returned base64 uses the standard alphabet, so it can be passed directly to tools like ``draft_gmail_message`` that expect standard (not URL-safe) base64. Default False preserves the existing behavior and response size. | |
| attachment_index | No | Zero-based attachment position from the message-content response. When the cap is enabled, this lets the server safely resolve Gmail's refreshed attachment IDs against current metadata before downloading. | |
| user_google_email | Yes | The user's Google email address. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |