save_attachment
Downloads an email attachment and saves it directly to disk, returning the local file path so users can open it immediately.
Instructions
Download an email attachment and save it directly to disk.
This is the PREFERRED tool for attachments — saves the file and returns the local path so the user can open it immediately. No base64 decoding needed.
Args: email_id: Email ID attachment_index: Index of attachment (from get_email_attachments, starting at 0) folder: Mail folder (default: INBOX) save_dir: Directory to save into (default: user's Downloads folder)
Returns: Dictionary with filename, saved_path, content_type, and size
Example: save_attachment(email_id="123", attachment_index=0)
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": "save_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | INBOX | |
| email_id | Yes | ||
| save_dir | No | ||
| attachment_index | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||