get_attachment
Retrieve Gmail attachment bytes by message and attachment ID, decode base64url data, and optionally save to a local file.
Instructions
Download Gmail attachment bytes (GET users.me.messages.attachments). Stock Gmail MCP cannot return file bytes. Decodes base64url; writes to disk when path is set; returns size, filename, attachmentId, and standard base64.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"messageId": "<messageId>",
"attachmentId": "<attachmentId>"
},
"name": "get_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | If set, write decoded bytes to this file (or directory) | |
| filename | No | ||
| messageId | Yes | ||
| attachmentId | Yes |