Save Email Attachment to Disk
save_attachmentSave a mail attachment to a local file and return its path. Use it for scanned PDFs, images, or documents that text extraction cannot read, or to pass a file to another tool.
Instructions
Save a mail attachment to a local file and return its path. Use for anything read_document cannot extract text from — scanned PDFs, photographed documents, images — and for handing a file to another tool. Read the saved file directly: PDFs and images are viewable without text extraction. Omit attachment_id when the message has exactly one attachment; otherwise get IDs from list_attachments.
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": {
"message_id": "<message_id>"
},
"name": "save_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | No | Email address of another mailbox to act on (delegated or shared), e.g. 'someone@example.com'. Omit for your own mailbox; required when this server signs in as an application. Only addresses this server is configured to allow will be accepted. | |
| out_dir | No | Directory to write into (default: the system temp directory). An existing file is never replaced; a numbered name is used instead. | |
| message_id | Yes | The message ID, or a short ref returned by scan_messages | |
| attachment_id | No | Which attachment to save. Optional when the message has exactly one. |