Skip to main content
Glama

get_attachment

Read-onlyIdempotent

Get one attachment of a message. Give it the message id (from search_messages or get_message) and the attachment's position in that message's attachments list, where 0 is the first attachment. By default it returns metadata plus a signed download URL good for 5 minutes, up to 10MB. Pass inline: true to get the file's bytes as content_base64 in this result instead, up to 5MB - use that when you cannot open URLs on this server, for example in a sandbox with restricted network access. Only reads mail; it never changes the mailbox.

Input Schema

NameRequiredDescriptionDefault
inlineNotrue returns the file's bytes as content_base64 instead of a download URL. Recommended when your environment cannot reach URLs on this server. Default false.
message_idYesThe message id from search_messages or get_message.
attachment_indexYesPosition (0-based) in that message's attachments list.

Output Schema

NameRequiredDescriptionDefault
urlNoShort-lived download link; present unless inline was requested
sizeYesSize in bytes
filenameYesFile name
message_idYesMessage the attachment belongs to
content_typeYesMIME type
content_base64NoBase64 file content; present only with inline
attachment_indexYesPosition in the message's attachments
expires_in_secondsNoSeconds the download link stays valid

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds genuinely new behavioral facts: the URL is signed and expires in 5 minutes, the URL path caps at 10MB while the inline path caps at 5MB, and the response shape differs (metadata + URL vs content_base64). The size/expiry tradeoff is exactly the kind of context an agent needs before choosing a mode.

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-loads the action, then the required inputs, then the mode tradeoff, then the safety note — good ordering with no filler sentences. The closing "Only reads mail; it never changes the mailbox" is largely redundant with readOnlyHint=true and destructiveHint=false, costing a small amount of efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a full output schema and annotations, the description covers the operational facts that matter: where ids come from, 0-based indexing, expiry, and size ceilings per mode. Minor gap: no mention of behavior for an out-of-range index or a message with no attachments, which an agent picking an index would want to know.

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% and already documents the 0-based index and inline flag, so the baseline is 3. The description earns above baseline by adding the size-limit asymmetry between the two modes (10MB URL vs 5MB inline), which is not present in any schema field.

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 ("Get one attachment of a message") and immediately distinguishes the operation from get_message by naming where the message id comes from. The attachment_index requirement makes it unambiguous that this retrieves a single binary/metadata object rather than the message body.

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?

Gives explicit conditional guidance for the key decision: default to the signed URL, pass inline:true "when you cannot open URLs on this server, for example in a sandbox with restricted network access." It also names the upstream tools (search_messages, get_message) for obtaining the id, though it never states when to prefer get_message over this tool outright.

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.