get_attachment
Download an email attachment by its ID. Use after get_email to fetch the actual attachment content. Pass the filename and mimeType from get_email's attachment metadata. Text files (txt, csv, json, html, xml, md) are returned as decoded text. Images (png, jpg, gif, webp) are returned as viewable image content. Other files are returned as base64-encoded data. Attachments over 10MB are rejected.
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": {
"emailId": "<emailId>",
"attachmentId": "<attachmentId>",
"filename": "<filename>",
"mimeType": "<mimeType>"
},
"name": "get_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailId | Yes | Email ID from search_email or get_email | |
| filename | Yes | Filename from get_email attachment metadata | |
| mimeType | Yes | MIME type from get_email attachment metadata (e.g. application/pdf, image/png) | |
| attachmentId | Yes | Attachment ID from get_email attachment metadata |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | ||
| content | Yes | Base64 data for binary, decoded text for text files | |
| encoding | Yes | ||
| filename | Yes | ||
| mimeType | Yes |