Skip to main content
Glama

Download attachment

download_attachment

Saves a message attachment to the server's private download folder and returns its local path, size, and SHA-256 without opening the message or overwriting files.

Instructions

Save one message attachment to the server's private download folder and return its local path, size and SHA-256. Never overwrites a file or opens the message. On Linux and macOS, files up to 256 KiB are may also be offered as a 15-minute MCP resource.

Input Schema

NameRequiredDescriptionDefault
filenameYesName to save as, e.g. its filename.
max_bytesNoRefuse larger files.
account_aliasYesLogin alias from list_accounts.
attachment_refYesmessage: the message_ref you opened; identifier, archived: from the attachment.

Output Schema

NameRequiredDescriptionDefault
sha256Yes
filenameYes
local_pathYes
size_bytesYes
content_typeYes
resource_uriYes
resource_ttl_secondsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • removedOutput schema / additionalProperties
      Removed value: -false
  2. Changed6 schema fields changedv2.3.1
    • changedInput schema / $defs / MessageReferenceInput / properties / account / pattern
      Previous value: -"^(?:[^\\s\\x00-\\x1f\\x7f]|[^\\s\\x00-\\x1f\\x7f](?:[^\\s\\x00-\\x1f\\x7f]| )*[^\\s\\x00-\\x1f\\x7f])$"New value: +"^[^\\s\\x00-\\x1f\\x7f](?: *[^\\s\\x00-\\x1f\\x7f])*$"
    • addedInput schema / properties / account_alias / description
      Added value: +"Login alias from list_accounts."
    • changedInput schema / properties / account_alias / pattern
      Previous value: -"^(?:[^\\s\\x00-\\x1f\\x7f]|[^\\s\\x00-\\x1f\\x7f](?:[^\\s\\x00-\\x1f\\x7f]| )*[^\\s\\x00-\\x1f\\x7f])$"New value: +"^[^\\s\\x00-\\x1f\\x7f](?: *[^\\s\\x00-\\x1f\\x7f])*$"
    • addedInput schema / properties / attachment_ref / description
      Added value: +"message: the message_ref you opened; identifier, archived: from the attachment."
    • addedInput schema / properties / filename / description
      Added value: +"Name to save as, e.g. its filename."
    • addedInput schema / properties / max_bytes / description
      Added value: +"Refuse larger files."
  3. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the write goes to a private download folder, existing files are never overwritten, the source message is not opened, and small files (≤256 KiB on Linux/macOS) may also be surfaced as a 15-minute MCP resource. These are exactly the side effects an agent needs before invoking a non-readOnly tool.

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?

Three front-loaded sentences with no filler; the core action and return values come first, safety constraints second. Minor blemish: the ungrammatical 'are may also be offered' slightly obscures the resource-offer clause.

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?

Because an output schema exists, the description need not explain return values, yet it still names them; write location, no-overwrite semantics, and size limits are covered. Only the resource-offer wording is a little ambiguous about when the resource is actually created.

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 description coverage is 100%, so the schema already documents filename, max_bytes, account_alias, and attachment_ref. The description adds no parameter-level detail beyond noting that it is a single attachment, so the baseline 3 applies.

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 message attachment to the server's private download folder') plus what it returns (local path, size, SHA-256). Clearly distinct from sibling read tools like get_message_content, since it is the only one that materializes a file on disk.

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

Usage Guidelines3/5

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

Usage is only implied: 'Never ... opens the message' hints that the message must already have been opened, and the schema notes that attachment_ref comes from the attachment and message_ref. There is no explicit 'call this after get_message_content when the user wants the file itself' or guidance on when not to use it.

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