Skip to main content
Glama

Download an attachment of a message

get_attachment
Read-onlyIdempotent

Download one attachment of a received message, by the index shown in read_message. Returns text files (txt, csv, md, json, ics, ...) as readable text and other files as an embedded base64 resource; with format "text" also PDFs and (if…

Instructions

Download one attachment of a received message, by the index shown in read_message. Returns text files (txt, csv, md, json, ics, ...) as readable text and other files as an embedded base64 resource; with format "text" also PDFs and (if enabled) images as their text, which is much cheaper to read. Blocked attachments (blocked in read_message) cannot be downloaded. To pass a file on, use forward_message or attach it with from_message in send_message instead of downloading it. Changes nothing.

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>",
      "index": "<index>"
    },
    "name": "get_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesMessage id from list_messages
indexYesAttachment index from read_message.attachments
formatNoauto: text files as text, others as file; text: the readable text of any file (PDF, image, text); file: always the file as base64auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / format
      Added value: +{
      +  "default": "auto",
      +  "description": "auto: text files as text, others as file; text: the readable text of any file (PDF, image, text); file: always the file as base64",
      +  "enum": [
      +    "auto",
      +    "text",
      +    "file"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / index / description
      Added value: +"Attachment index from read_message.attachments"
  3. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds the return-shape behavior that annotations cannot express: text files come back as readable text, others as an embedded base64 resource, and PDFs/images can be converted to text when enabled. It also discloses the blocked-attachment failure mode. 'Changes nothing' is consistent with readOnlyHint, not contradictory.

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 core action and packed with useful detail in a single paragraph. Slightly dense and the trailing 'Changes nothing' largely restates the readOnly annotation, but nothing is wasted.

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?

No output schema exists, and the description fully covers what is returned for each format and how to recover the content. Along with the prerequisite pointer to read_message, an agent has everything needed to call it correctly.

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 coverage is 100%, so the baseline is 3; the description goes beyond the schema by explaining the cost tradeoff of format="text" and the conditional availability of PDF/image extraction ('if enabled'), which the enum description does not convey.

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?

Specific verb+resource: 'Download one attachment of a received message, by the index shown in read_message.' It scopes the operation to exactly one attachment and ties the index parameter back to its source tool, distinguishing it from read_message and forward_message.

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 alternatives are named with their selecting condition: to pass a file on, use forward_message or from_message in send_message instead of downloading. It also states an exclusion (blocked attachments cannot be downloaded) and a performance-motivated option (format "text" is much cheaper).

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