Save an attachment
save_attachmentWrite email attachments to disk and return the saved file paths. Handles images, scanned PDFs, and other non-text content. Files self-delete after a short time by default.
Instructions
Write attachment(s) to disk and return the path(s). Use for images, scanned PDFs, or anything not text-extractable. EPHEMERAL by default — files self-delete after the TTL.
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": {
"uid": "<uid>"
},
"name": "save_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | ||
| folder | No | Default INBOX. | |
| dry_run | No | Preview exactly what would happen and change nothing. Needs no confirmation. | |
| persist | No | Keep the file permanently. Default false = auto-deleted after the TTL so nothing lingers for the user to open by accident. | |
| dest_dir | No | Sub-path under the attachments dir. Writes outside it are refused. | |
| filename | No | Partial match; omit to save all documents. | |
| uidvalidity | No | UIDVALIDITY reported alongside the uid. Pass it back so a mailbox resync cannot make this act on the wrong message. | |
| include_inline | No |