fetch-attachment
Retrieve an email attachment's raw bytes inline as base64 by message ID and attachment name to process contents without saving a file; attachments over 3 MiB are refused.
Instructions
Use when: retrieving an attachment's raw bytes inline as base64 (by message id and attachmentName), e.g. to process its contents without keeping a file. Returns: up to 3 MiB of decoded attachment bytes, base64-encoded, with its size and (for IMAP) MIME type. Larger attachments are refused; use save-attachment instead. Do not use when: you don't know the attachment name (use list-attachments first) or you just want it saved to disk (use save-attachment). Safety: leaves no file behind, but the AppleScript path is not disk-free — Mail writes the attachment into a private temp directory, which is read back and then deleted. Needs no Full Disk Access either way: Mail performs that write under the Automation grant, and this server never reads the mail store itself.
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>"
},
"name": "fetch-attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| attachmentName | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | No | ||
| mimeType | No | ||
| contentBase64 | No | ||
| attachmentName | No |