Save an attachment as a file
save_attachmentSaves a Proton Mail message attachment to the configured local directory so you can open or work with it; saved files are temporary and do not overwrite existing files.
Instructions
Saves one attachment of a message as a file on this machine, so it can be opened or worked with, a PDF or a spreadsheet for instance. The index comes from the attachment list in get_message. Only works once the user has set PROTON_MCP_ATTACHMENT_DIR to a directory; without it the answer says how to set it up, which is worth passing on. The file goes into that directory or a folder inside it, never anywhere else, and never replaces an existing file. It is deleted 1 hour(s) after saving and when this server stops, so copy it if you need it longer or elsewhere, or fetch it again. Its content comes from a third party.
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": {
"messageId": "<messageId>",
"index": "<index>"
},
"name": "save_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | Index of the attachment, as shown by get_message. Starts at 0. | |
| folder | No | Optional: a folder inside the configured directory, absolute or relative to it, created if missing and removed again once the files saved into it are gone. Anything outside the directory is refused. | |
| mailbox | No | Optional: the mailbox to look in first. | |
| messageId | Yes | The message id the attachment belongs to. |