Skip to main content
Glama

Read an email attachment

get_attachment
Read-only

Reads one attachment of an email, by its position in the attachments list returned by get_message (index 0 = first). Documents (PDF, Word .docx, text, HTML, CSV, JSON, calendar files) are returned as text, truncated beyond 50,000 characters (truncated: true); images (PNG, JPEG, GIF, WebP) are returned as the image itself. Other formats (spreadsheets, archives, scanned PDFs without text) are reported as unsupported. Attachments over 10 MB are not read. Does not mark the message as read.

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

Input Schema

NameRequiredDescriptionDefault
uidYesIMAP UID of the message, as returned by search and listing tools.
indexNoPosition in get_message's attachments list, starting at 0.
folderNoIMAP folder containing the message. Defaults to INBOX.INBOX
accountIdYesAccount id, as returned by list_accounts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare it a non-destructive read; the description adds substantial behavioral detail beyond that: 50,000-character truncation with a (truncated: true) flag, image passthrough, unsupported formats (spreadsheets, archives, scanned PDFs), a 10 MB size cutoff, and the fact it does not mark the message read.

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 core behavior is front-loaded in the first clause, followed by return-format and limit details with no filler. The middle sentence is long and packs three distinct format cases, but each clause carries information an agent needs.

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 fully covers the return contract: which formats come back as text, which as images, which are unsupported, and how truncation is signaled. Nothing an agent needs to invoke or interpret the call 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% and already documents index as 'position in get_message's attachments list, starting at 0' and uid/folder/accountId provenance. The description's 'index 0 = first' restates rather than extends the schema, so it lands at the baseline.

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 ('Reads one attachment of an email') and pins scope precisely to a position in the list returned by get_message, which separates it from get_message itself and other read tools.

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?

The dependency on get_message's attachments list makes the when-to-use context clear, and the stated format/size limits tell the agent when the call will not yield content. It does not name an alternative for unsupported formats, but no obvious sibling performs that role.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources