download_attachment
Download an email attachment by ID, receiving either a direct download URL or a saved file path with size.
Instructions
Download an email attachment. If savePath is provided, saves the file to disk and returns the file path and size. Otherwise returns a download URL.
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": {
"emailId": "<emailId>",
"attachmentId": "<attachmentId>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailId | Yes | ID of the email | |
| savePath | No | File path to save the attachment to. May be absolute or relative; relative paths resolve against ~/Downloads/fastmail-mcp/ (configurable via FASTMAIL_DOWNLOAD_DIR), so a bare filename lands there in one step. Absolute paths must fall within that directory; traversal or symlink escape outside it is rejected for security. To save directly into your own location, set FASTMAIL_DOWNLOAD_DIR to that root. Parent directories will be created automatically. | |
| attachmentId | Yes | ID of the attachment |