Skip to main content
Glama

get_attachment

Read-only

Download an email attachment by its ID. Use after get_email to fetch the actual attachment content. Pass the filename and mimeType from get_email's attachment metadata. Text files (txt, csv, json, html, xml, md) are returned as decoded text. Images (png, jpg, gif, webp) are returned as viewable image content. Other files are returned as base64-encoded data. Attachments over 10MB are rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesEmail ID from search_email or get_email
filenameYesFilename from get_email attachment metadata
mimeTypeYesMIME type from get_email attachment metadata (e.g. application/pdf, image/png)
attachmentIdYesAttachment ID from get_email attachment metadata

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes
contentYesBase64 data for binary, decoded text for text files
encodingYes
filenameYes
mimeTypeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, indicating a safe read operation. The description adds valuable behavioral context beyond annotations: it specifies return formats based on file types (text files as decoded text, images as viewable content, others as base64), and mentions a 10MB size limit for attachments. This provides practical implementation details not covered by annotations.

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?

The description is efficiently structured with zero waste: the first sentence states the core purpose, subsequent sentences provide usage guidance and behavioral details, and every sentence adds essential information. It's appropriately sized for a tool with multiple behavioral nuances.

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?

Given the tool's complexity (multiple return formats based on file types, size limits) and the presence of both comprehensive annotations and an output schema, the description is complete. It covers purpose, usage context, behavioral traits, and constraints without needing to explain return values (handled by output schema).

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 the schema already documents all four parameters thoroughly. The description adds minimal parameter semantics beyond the schema—it mentions that filename and mimeType should come from get_email's attachment metadata, which is somewhat implied in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

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?

The description clearly states the specific action ('Download an email attachment') and resource ('by its ID'), distinguishing it from siblings like get_email (which fetches email metadata) and search_email (which searches emails). It explicitly mentions the tool's scope of fetching actual attachment content.

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?

The description provides explicit guidance on when to use this tool ('Use after get_email to fetch the actual attachment content') and prerequisites ('Pass the filename and mimeType from get_email's attachment metadata'), clearly differentiating it from other email-related tools like get_email or search_email.

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.