Skip to main content
Glama

Gmail: Get attachment

gmail_get_attachment
Read-only

Retrieves a Gmail message attachment by ID and returns its filename, MIME type, size, and base64 data for download or processing.

Instructions

[UNIFIED] Get a message attachment by id. Returns the attachment filename, mime type, size, and base64-encoded data. Find attachment ids in a get_message (format=full) response under parts[].body.attachmentId.

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": {
      "site": "<site>",
      "message_id": "<message_id>",
      "attachment_id": "<attachment_id>"
    },
    "name": "gmail_get_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYes
message_idYes
attachment_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered; the description adds value by disclosing the return shape, notably that data comes back base64-encoded, which affects how the agent must handle the result. It omits practical caveats such as attachment size limits or possible truncation, keeping it short of a 5.

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?

Three short sentences, front-loaded with the action, then the return contract, then the parameter-sourcing hint. Every sentence adds information an agent would otherwise have to guess, and there is no filler.

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 correctly takes on the burden of explaining return values, and it does so concisely. The remaining gap is that two of three required parameters are undocumented anywhere, which matters somewhat for a tool whose inputs are otherwise opaque strings.

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 parameter meaning; it does explain where attachment_id comes from (parts[].body.attachmentId), which is genuinely useful. However, message_id and site are left entirely to inference, so half the compensation expected at this coverage level is missing.

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 names a specific verb and resource ('Get a message attachment by id') and immediately scopes the return payload (filename, mime type, size, base64 data). It also distinguishes itself from gmail_get_message by explaining that attachment ids originate from that tool's format=full response, so an agent can tell which tool to reach for.

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?

It gives a concrete precondition and a pointer to the sibling tool that produces the required attachment_id, which is exactly the guidance an agent needs before calling. It does not state when NOT to use this tool (e.g. inline images or truncated attachments), so it falls short of full when/when-not coverage.

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

Deploy Server

Other Tools