save_attachment
Download a specific email attachment from a message and save it to a local file path, returning its written path, size, MIME type, and original filename.
Instructions
Download one attachment from a message and write it to the local filesystem.
The mailbox is not modified. Returns the written path, size, MIME type and original filename. An existing file at the target path is overwritten.
Args:
account: Account name from list_accounts.
folder: Folder containing the message.
uid: Message UID.
part: 1-based part index from read_email's attachments list.
save_to: Destination. A directory (trailing slash, existing
directory, or a path without an extension) keeps the original
filename; anything else is used as the full file path. ~ is
expanded and missing directories are created.
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": {
"account": "<account>",
"folder": "<folder>",
"uid": "<uid>",
"part": "<part>",
"save_to": "<save_to>"
},
"name": "save_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | ||
| part | Yes | ||
| folder | Yes | ||
| account | Yes | ||
| save_to | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mime | Yes | ||
| path | Yes | ||
| size | Yes | ||
| filename | Yes |