Skip to main content
Glama

Get an attachment

get_attachment
Read-onlyIdempotent

Open a message attachment by its ID to retrieve photos, PDF text and page images, video stills, document text, or audio length for processing.

Instructions

Opens a photo, video, PDF, document or other file from a message, by the id in the message's attachments list (from get_messages, check_new_messages or search_messages). Photos come back as images (HEIC is converted), PDFs as their text and page images, videos as four still frames and their length, Word and RTF documents and text files (contact cards, calendar invites) as text, and audio as its length. Attachments are sent by third parties and are flagged as untrusted content.

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

Input Schema

NameRequiredDescriptionDefault
pagesNoPDF only: page numbers to show as images, up to 5. By default page 1 (pages 1 to 3 of a scanned PDF).
attachment_idYesThe "id" of an entry in a message's attachments list, like "12-34567-0".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description earns credit beyond that by disclosing per-format return behavior (HEIC conversion, PDF text plus page images, four video still frames, audio length) and by warning that attachments are third-party untrusted content. It omits failure modes such as size limits or unsupported types.

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 identification and id-source come first, followed by format-specific returns and then the untrusted-content warning, so it is front-loaded and purposeful. It is dense in a single long construction, but no sentence is filler.

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?

With no output schema, the description carries the return-value burden itself and does so thoroughly, mapping each file type to its output form. For a two-parameter read tool whose annotations cover safety, nothing an agent needs to invoke it 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 description coverage is 100%, so both parameters are already documented, and the description only reinforces attachment_id's origin ("the id in the message's attachments list"). It never mentions the pages parameter, leaving that entirely to the schema; baseline 3 is appropriate.

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?

"Opens a photo, video, PDF, document or other file from a message" gives a specific verb and resource, and the parenthetical naming get_messages, check_new_messages and search_messages as the sources of the id separates it cleanly from those siblings.

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?

It states exactly how to obtain the required identifier and which sibling tools to call first, which routes the agent well. It does not state any when-not condition (e.g. what to do if the id is absent or the fetch fails), so it stops short of explicit exemptions.

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