Skip to main content
Glama

download_attachment

Save an email attachment to a local file path using message and attachment IDs from get_thread; existing files are kept and the response returns the actual saved path.

Instructions

Download an attachment to a local file path. If MAILWARDEN_DOWNLOAD_DIR is set, destPath is resolved inside (and restricted to) that directory. USE WHEN: the user wants an attachment saved to disk (IDs come from get_thread's attachment metadata). SIDE EFFECTS: writes a local file; never overwrites — an existing file gets a numeric suffix (file-1.pdf). The response's 'saved' field is the path actually used. Mailbox unchanged. On Windows the file gets the Mark of the Web (Zone.Identifier, Internet zone), as a browser download does, so opening an executable or a macro document warns first; markedAsDownloaded says whether that worked (false when it could not be written: a file system without alternate data streams, such as FAT or some network shares, or the file already removed, by a virus scanner for instance) and is absent on macOS and Linux, where no mark is written. The attachment is mail from a sender: do not open or run it on the user's behalf.

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": {
      "messageId": "<messageId>",
      "attachmentId": "<attachmentId>",
      "destPath": "<destPath>"
    },
    "name": "download_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
destPathYes
messageIdYes
attachmentIdYes

Output Schema

NameRequiredDescriptionDefault
savedYes
markedAsDownloadedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.34.0
    • addedOutput schema / properties / markedAsDownloaded
      Added value: +{
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changedv0.32.0
    • 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"
  3. Changed1 schema field changedv0.25.0
    • removedInput schema / additionalProperties
      Removed value: -false
  4. First observedv0.1.8

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that a local file is written, that existing files are never overwritten but get a numeric suffix, that destPath is confined to MAILWARDEN_DOWNLOAD_DIR when set, and that the mailbox is unchanged. The Mark-of-the-Web paragraph explains platform-specific behavior and when markedAsDownloaded can be false, which the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false) could not convey.

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

Conciseness3/5

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

The action and the USE WHEN condition are correctly front-loaded, but the Mark-of-the-Web section sprawls into a long nested parenthetical about alternate data streams and virus scanners that costs more attention than it returns for the invocation decision.

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?

Even though an output schema exists, the description still explains the two fields that matter ('saved' and 'markedAsDownloaded') and covers the failure/edge cases an agent would otherwise have to discover by trial. Nothing needed to call this three-parameter write tool correctly is missing.

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?

Schema coverage is 0%, so the description has to compensate. It meaningfully explains destPath (resolved inside and restricted to MAILWARDEN_DOWNLOAD_DIR) and locates the IDs in get_thread's attachment metadata, but it never distinguishes messageId from attachmentId or states their format.

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

Purpose4/5

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

States a specific verb+resource ('Download an attachment to a local file path') and implicitly distinguishes itself from read_attachment by framing the outcome as a file saved to disk rather than content returned. It does not name read_attachment explicitly, so the sibling differentiation is inferred from the 'saved to disk' framing rather than stated.

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?

'USE WHEN: the user wants an attachment saved to disk' gives a clear triggering condition and points to get_thread as the source of the attachment IDs. It also adds a guardrail ('do not open or run it on the user's behalf') but never names read_attachment as the alternative when the user only wants to view content.

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