Skip to main content
Glama
apple-mail-mcp

apple-mail-mcp

by sweetrb

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

NameRequiredDescriptionDefault
idYes
savePathYes
attachmentNameYes

Output Schema

NameRequiredDescriptionDefault
okNo
savedPathNo
attachmentNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.10.24
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv2.10.8
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
  3. Addedv2.8.14
  4. Removedv2.8.10
  5. First observedv2.6.1

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false) by disclosing that this writes a new file, never overwrites, and that savePath must be an existing directory within an enumerated allowlist of roots. It also discloses refusal rules: hidden files/folders, credential stores, other ~/Library locations, and path separators or '..' in attachmentName.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded 'Use when' line, then compact labeled blocks for Returns, exclusions, and Safety. Every sentence carries actionable information; the restriction list is dense but not padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter write tool with an output schema, the description covers selection, exclusions, filesystem preconditions, and sandbox restrictions. Return values are already covered by the output schema, so the brief 'Returns' line is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the load; it does for attachmentName (no separators or '..') and savePath (must pre-exist and fall under an allowed root or configured env root). It says less about the id parameter's accepted forms (e.g. the imap: prefix in the schema pattern), so one gap remains.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: writing one of a message's attachments to disk, keyed by message id and attachmentName, into savePath. It also clarifies the resulting filename (savePath/attachmentName), and the sibling names list-attachments and fetch-attachment make the boundary obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use when' and 'Do not use when' clauses, each with a named alternative and the condition that selects it: unknown attachment name → list-attachments; bytes inline → fetch-attachment. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.