Skip to main content
Glama

download_attachment

Saves an Outlook email attachment or inline image to disk by message ID and returns JSON metadata so AI agents can read the media file directly.

Instructions

Download an Outlook email attachment or inline screenshot to disk and return structured JSON { ok, path, file_name, mime_type, size_bytes, is_image } so multimodal AI agents can read media directly from disk. Fetches the full attachment bytes with Graph requests unless offline reads them from the cache; time grows with file size.

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": {
      "message_id": "<message_id>"
    },
    "name": "download_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
offlineNoRead cached message metadata/inline bytes from SQLite without Graph API call
attachmentNoAttachment ID, filename, or 0-based index
message_idYesOutlook message ID
output_dirNoTarget directory on disk (defaults to configured download_dir)
attachment_indexNo0-based attachment index (defaults to first image or first attachment)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It does disclose useful traits: the exact returned JSON keys, that bytes come from Graph unless offline reads the SQLite cache, and that latency scales with file size. It omits notable behavior for a disk-writing tool — whether existing files are overwritten, where the default download_dir is, and what happens on missing/expired attachments.

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?

The purpose and return contract are front-loaded in the first clause, with operational caveats trailing. The single-sentence construction with an embedded JSON signature is dense but readable; "so multimodal AI agents can read media directly from disk" is slightly promotional but justifies the disk-write design.

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, yet the description enumerates the returned JSON fields, which is exactly what an agent needs to consume results. Combined with full schema coverage and the cache/Graph distinction, the definition is nearly complete; only failure modes and file-overwrite semantics remain unaddressed for a tool that writes to disk.

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 all five parameters are already documented in the input schema. The description adds contextual value only for `offline` (cache vs Graph) and implicitly explains `is_image` in the return payload; it adds nothing about `output_dir`, `attachment`, or `attachment_index` beyond the schema text. 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 ("Download an Outlook email attachment or inline screenshot to disk") plus the return shape, which no sibling tool offers. An agent can immediately tell this apart from get_message or list_messages, which deal with message content rather than binary attachment bytes.

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?

The description implies the use case (fetching attachment bytes for a multimodal agent to read from disk) but never states when to prefer it, when not to use it, or what prerequisite conditions exist (e.g. needing a message_id obtained from list_messages/get_message). The offline flag's tradeoff is described, but that is a parameter behavior rather than tool-selection guidance.

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