Skip to main content
Glama

gmail_download_attachment

Read-onlyIdempotent

Downloads a Gmail attachment's content by message ID and file name, returning small files inline as base64 or larger ones as a one-time link the human opens in their own signed-in browser.

Instructions

Download a Gmail attachment's content. Identify the attachment by the name returned from gmail_list_message_attachments. Returns {delivery: 'inline', name, mime_type, size_bytes, content_base64} for a small attachment, or {delivery: 'link', name, size_bytes, download_url, expires_at, note} for a larger one: a one-time link the human opens in their own signed-in browser. Requires user approval.

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": {
      "message_id": "<message_id>",
      "attachment_name": "<attachment_name>",
      "reason": "<reason>"
    },
    "name": "gmail_download_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYesOne sentence: why are you calling this tool right now?
message_idYesId of the Gmail message, from gmail_list_messages (its id field).
attachment_nameYesFile name of the attachment, exactly as gmail_list_message_attachments returns it in its name field; a name that matches none fails.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv7.0.3
    • removedInput schema / properties / destination_dir
      Removed value: -{
      -  "description": "Local install only: where to save the attachment -- required, no default. On an organization-managed install it is ignored and nothing is saved to it; any value will do. Use ~/Downloads (or a path the user specified) if the user should find this file afterward; use your own working/scratch directory if it's only for you to read or process.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "message_id",
      -  "attachment_name",
      -  "destination_dir",
      -  "reason"
      -]New value: +[
      +  "message_id",
      +  "attachment_name",
      +  "reason"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / attachment_name / description
      Added value: +"File name of the attachment, exactly as gmail_list_message_attachments returns it in its name field; a name that matches none fails."
    • addedInput schema / properties / message_id / description
      Added value: +"Id of the Gmail message, from gmail_list_messages (its id field)."
  3. First observedv5.3.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/non-destructive annotations by disclosing the two delivery modes, the exact return shapes, and that large attachments come back as a one-time link the human must open in their own signed-in browser. It also surfaces the approval gate, which is behavior an agent needs before calling.

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?

Front-loaded with the action, then the identifier source, then the return contract, then the approval requirement, in that priority order. The inline/link return shapes are enumerated compactly rather than in prose, and nothing is redundant.

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 no output schema, the description carries the return contract itself and does so explicitly for both delivery paths including the expires_at/note fields. Combined with the approval note and the identifier source, an agent has everything needed to invoke and interpret the result.

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 coverage is 100%, so all three parameters (including the reason field) are already documented in structured form. The description only reinforces the provenance of attachment_name and does not add format, syntax, or constraint detail beyond the schema, so the baseline of 3 applies.

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 ('Download a Gmail attachment's content') and immediately anchors it to the sibling that produces the identifier ('gmail_list_message_attachments'), so an agent can distinguish downloading from listing without opening either schema.

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?

Implies the required workflow ordering by telling the agent to take the name from gmail_list_message_attachments, and flags that user approval is needed before the call. It does not state when downloading is inappropriate or name an alternative download path, so no explicit exclusion guidance.

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