Skip to main content
Glama

Read attachment

read_attachment
Read-only

Read an attachment. Word (.doc/.docx), RTF, HTML, ODT and PDF, plus text formats like .csv/.json/.ics, come back as plain text. Images (PNG, JPEG, GIF, WebP, HEIC, TIFF) come back as an image you can see directly, converted and downscaled when needed, so there is no need to save them first. Get mail_id and attachment_id from get_email's attachments list, where extractable tells you in advance whether this will work. For anything else (.xlsx, .pptx, archives) use save_attachment and open the file with your own tools. An attachment Mail has not downloaded yet is fetched first, in the background (up to a minute); if it is still downloading after that, the error says so and the same call can be retried.

Input Schema

NameRequiredDescriptionDefault
mail_idYes
max_charsNo
attachment_idYes

Output Schema

NameRequiredDescriptionDefault
nameYes
textYes
charsYes
methodYes
truncatedYes
content_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish read-only, non-destructive, closed-world behavior, but the description adds substantial context beyond them: silent format conversion, image downscaling, the need to fetch not-yet-downloaded attachments in the background, the up-to-a-minute wait, and that the error message permits retrying the same call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although a single dense paragraph, every sentence carries distinct operational value: format handling, image behavior, ID sourcing, the unsupported-type fallback, and the background-fetch/retry contract. Nothing is redundant and the primary behavior is front-loaded.

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 an output schema present, return values need no explanation, and annotations cover the safety profile. The description supplies everything else an agent needs to call correctly — formats, ID source, fallback path, and retry semantics.

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 0%, so the description must carry the load. It explains the provenance of mail_id and attachment_id (get_email's `attachments` list), but says nothing about `max_chars` (default 40000), which controls text truncation — a meaningful gap for a read tool that returns large documents.

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 ('Read') and resource ('attachment') and immediately enumerates the formats it handles, plus how each returns (plain text vs. visible image). It is clearly distinguishable from siblings like save_attachment, get_email, and find_attachments.

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?

Explicitly names the alternative for unsupported types ('For anything else (.xlsx, .pptx, archives) use save_attachment and open the file with your own tools') and tells the agent where to obtain the required IDs from get_email's `attachments` list. It even notes the `extractable` flag as a pre-flight check.

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.