download_attachment
Download an email attachment and save it to a specified file path. Provide the email ID, attachment index, and destination; returns the saved file details.
Instructions
Download and save an email attachment to a file on disk. Use this after list_attachments to get the 1-based attachment index. Returns the saved file path, name, and size in bytes. Writes the file to the specified save_path — the parent directory must already exist. Returns an error if the email or attachment does not exist, the directory is invalid, or the attachment exceeds the size limit.
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>",
"save_path": "<save_path>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| email_id | Yes | The email ID containing the attachment (e.g., from list_emails) | |
| save_path | Yes | Absolute file path where the attachment should be saved (e.g., "/tmp/report.pdf") | |
| attachment_index | Yes | The 1-based index of the attachment (e.g., 1 for the first attachment from list_attachments) |