download_attachment
Downloads a specific email attachment by email ID and attachment index, returning its filename, content type, size, and base64-encoded data for saving or processing.
Instructions
Download a specific attachment from an email.
Args: email_id: Email ID attachment_index: Index of attachment (from get_email_attachments, starting at 0) folder: Mail folder (default: INBOX)
Returns: Dictionary with filename, content_type, size, and data_base64 (base64 encoded content)
Example: download_attachment(email_id="123", attachment_index=0)
Note: The attachment content is returned as base64 encoded string in 'data_base64' field. You can decode it and save to file.
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": {
"email_id": "<email_id>",
"attachment_index": "<attachment_index>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | INBOX | |
| email_id | Yes | ||
| attachment_index | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||