Skip to main content
Glama

Get attachment

get_attachment
Read-onlyIdempotent

Returns an attachment. Text-like files (txt, csv, json, xml) and PDFs with a text layer come back as text; anything else as a one-hour download link: give that link to the user instead of reading the file. Pass inline=true only when the content itself is needed here (max 2097152 bytes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesuid from search_messages
partYespart id from get_message
folderNoDefault: Gmail All Mail, else INBOX
inlineNoEmbed the bytes instead of a link
accountYeslist_accounts id

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +{}
    • removedInput schema / properties / save_to
      Removed value: -{
      -  "description": "stdio: folder in policy.attachment_dirs; returns the path",
      -  "type": "string"
      -}
  2. Changed5 schema fields changed
    • changedInput schema / properties / account / description
      Previous value: -"Account id from list_accounts"New value: +"list_accounts id"
    • changedInput schema / properties / folder / description
      Previous value: -"Folder/label path. Defaults to All Mail on Gmail, INBOX elsewhere."New value: +"Default: Gmail All Mail, else INBOX"
    • changedInput schema / properties / inline / description
      Previous value: -"Embed the binary content in the result instead of returning a link"New value: +"Embed the bytes instead of a link"
    • changedInput schema / properties / save_to / description
      Previous value: -"Claude Desktop / Claude Code only: directory inside policy.attachment_dirs to write the file into; the tool returns the path"New value: +"stdio: folder in policy.attachment_dirs; returns the path"
    • changedInput schema / properties / uid / description
      Previous value: -"uid from search_messages: a number on IMAP mailboxes, an id string on Outlook; pass it back exactly as returned"New value: +"uid from search_messages"
  3. Changed7 schema fields changed
    • addedInput schema / properties / save_to
      Added value: +{
      +  "description": "Claude Desktop / Claude Code only: directory inside policy.attachment_dirs to write the file into; the tool returns the path",
      +  "type": "string"
      +}
    • addedInput schema / properties / uid / description
      Added value: +"uid from search_messages: a number on IMAP mailboxes, an id string on Outlook; pass it back exactly as returned"
    • addedInput schema / properties / uid / maxLength
      Added value: +512
    • removedInput schema / properties / uid / maximum
      Removed value: -9007199254740991
    • addedInput schema / properties / uid / minLength
      Added value: +1
    • removedInput schema / properties / uid / minimum
      Removed value: -1
    • changedInput schema / properties / uid / type
      Previous value: -"integer"New value: +"string"
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, openWorld), yet the description still adds substantial behavioral context: text-like files and text-layer PDFs return as text while others return a one-hour download link, plus a byte cap on inline. These return-format and expiry traits are not in any structured field.

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-loaded with the purpose, then behavior and parameter guidance in a single tight passage with no filler. It is dense but every clause carries information the agent needs.

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 no output schema, the description carries the return-value burden and does so well by describing both result shapes (text vs. one-hour link). Combined with 100% schema coverage for parameters, an agent has enough to invoke it correctly.

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%, establishing a baseline of 3, but the description earns above that by explaining when to set inline and the max byte size, which the schema's terse 'Embed the bytes instead of a link' does not convey. It adds real decision value beyond the schema.

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+resource ('Returns an attachment') and immediately characterizes the two return modes, so an agent knows exactly what it gets. This clearly distinguishes it from siblings like get_message or fetch, which return message bodies rather than 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit conditional guidance for the inline parameter ('Pass inline=true only when the content itself is needed here') and tells the agent to hand the link to the user rather than read the file. It doesn't name an alternative sibling tool, but the when/when-not logic for inline is clear.

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.