save-attachment
Write an email attachment to disk by message id and attachment name, saving it into an allowed directory without overwriting existing files.
Instructions
Use when: writing one of a message's attachments to disk, by message id and attachmentName, into the savePath directory (saved as savePath/attachmentName). Returns: a confirmation of the saved file path. Do not use when: you don't know the attachment name (use list-attachments first) or want the bytes inline rather than on disk (use fetch-attachment). Safety: writes a new file to disk and never overwrites — savePath must be an existing directory under ~/Downloads, ~/Desktop, ~/Documents, iCloud Drive, CloudStorage, a temporary directory, or a root named in APPLE_MAIL_MCP_ATTACHMENT_SAVE_ROOTS. Hidden files and folders, credential stores and other ~/Library folders are refused, and attachmentName may not contain path separators or '..'.
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": {
"id": "<id>",
"attachmentName": "<attachmentName>",
"savePath": "<savePath>"
},
"name": "save-attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| savePath | Yes | ||
| attachmentName | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| savedPath | No | ||
| attachmentName | No |