Skip to main content
Glama
mail-mcp

mail-mcp

download_attachment

Saves a selected email attachment to the configured download folder and returns its local path without overwriting existing files.

Instructions

Save one attachment (part number from get_message, e.g. "2" or "1.2") under the download folder (default ~/Library/Application Support/mail-mcp/attachments//; settings.download_dir in accounts.toml) and return its local path. Never overwrites existing files.

The file is marked with com.apple.quarantine (quarantined says whether that worked) and the result
carries warnings for executable or active-content types. Do not open or run a downloaded file
unless the user asks for it. Refused where allow_download = false, and above
settings.max_attachment_bytes (default 50 MB).

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": {
      "account": "<account>",
      "uid": "<uid>",
      "part": "<part>"
    },
    "name": "download_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidYes
partYes
folderNoINBOX
accountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations: never overwrites, applies com.apple.quarantine and reports whether that succeeded, surfaces warnings for executable/active-content types, and enumerates refusal gates (allow_download = false, settings.max_attachment_bytes default 50 MB). This is consistent with readOnlyHint=false and destructiveHint=false — it writes new files but destroys nothing existing.

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

Conciseness4/5

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

Front-loaded with the action and destination, then constraints in descending priority; every sentence carries information. The nested parentheticals about settings keys make it denser than necessary but not wasteful.

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

Completeness4/5

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

No output schema exists, so the description usefully documents the return value (local path, quarantined flag, warnings) and the failure modes. The one meaningful gap is the unexplained "folder" parameter and its relationship to the account/uid addressing of the message.

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

Parameters3/5

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

With 0% schema coverage the description must carry the load, and it explains "part" precisely with format examples ("2" or "1.2") plus the destination path. However, it never explains uid, account, or the "folder" parameter, and its phrase "download folder" risks being confused with the schema's "folder" property (default INBOX), which is presumably the source mail folder.

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 ("Save one attachment ... and return its local path") and ties it to the sibling that produces the input ("part number from get_message"). An agent can distinguish this from get_message or send_message without opening a schema.

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

Usage Guidelines4/5

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

Gives a clear prerequisite chain (obtain the part number from get_message first) and an explicit post-download rule ("Do not open or run a downloaded file unless the user asks for it"). It also names refusal conditions, but does not point to an alternative tool for inspecting attachment content without downloading.

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