Get email attachment
google_gmail_get_attachmentDownload a Gmail attachment by message and attachment ID, returning text or base64 for binary files; save large attachments to a local path to avoid inline size limits.
Instructions
Download a single attachment by message ID and attachment ID. Text-like files are returned decoded as text; binary files as base64. Attachments that would produce an inline result over 6 MB are rejected — pass saveToPath to write the raw bytes to a local file instead. The limit is measured on the JSON-RPC frame, not the raw bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Message ID. | |
| partId | No | Stable part ID (from list_attachments); preferred over attachmentId for lookup. | |
| account | No | Account nickname to use. | |
| maxBytes | No | Inline size limit in bytes (default 6 MB), measured on the JSON-RPC frame the client receives. Escaping can inflate a payload (base64 ~1.33x, NUL-heavy text ~7x). Ignored when saving to disk. | |
| saveToPath | No | Local path to write the raw bytes to (returns savedTo and kind "saved" instead of an inline payload). Must be inside the save root: GOOGLE_MCP_SAVE_ROOT, default ~/Downloads. | |
| attachmentId | Yes | Attachment ID (from list_attachments). |