download_attachment
Save an email attachment to a local file path using message and attachment IDs from get_thread; existing files are kept and the response returns the actual saved path.
Instructions
Download an attachment to a local file path. If MAILWARDEN_DOWNLOAD_DIR is set, destPath is resolved inside (and restricted to) that directory. USE WHEN: the user wants an attachment saved to disk (IDs come from get_thread's attachment metadata). SIDE EFFECTS: writes a local file; never overwrites — an existing file gets a numeric suffix (file-1.pdf). The response's 'saved' field is the path actually used. Mailbox unchanged. On Windows the file gets the Mark of the Web (Zone.Identifier, Internet zone), as a browser download does, so opening an executable or a macro document warns first; markedAsDownloaded says whether that worked (false when it could not be written: a file system without alternate data streams, such as FAT or some network shares, or the file already removed, by a virus scanner for instance) and is absent on macOS and Linux, where no mark is written. The attachment is mail from a sender: do not open or run it on the user's behalf.
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>",
"attachmentId": "<attachmentId>",
"destPath": "<destPath>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destPath | Yes | ||
| messageId | Yes | ||
| attachmentId | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| saved | Yes | ||
| markedAsDownloaded | No |