Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Get Gmail Attachment Content

get_gmail_attachment_content

Download a Gmail email attachment to local disk and return a file path, temporary URL, or base64 data for sandboxed clients.

Instructions

Downloads an email attachment and saves it to local disk.

In stdio mode, returns the local file path for direct access. In HTTP mode, returns a temporary download URL (valid for 1 hour). May re-fetch message metadata to resolve filename and MIME type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYesThe ID of the Gmail message containing the attachment.
attachment_idYesThe ID of the attachment to download.
return_base64NoWhen True, includes the full attachment as a standard base64 string in the response (in addition to any file path or download URL). Useful for sandboxed clients that cannot reach localhost download URLs or the MCP server's local file paths (e.g. containerized agents with network allowlists). The returned base64 uses the standard alphabet, so it can be passed directly to tools like ``draft_gmail_message`` that expect standard (not URL-safe) base64. Default False preserves the existing behavior and response size.
attachment_indexNoZero-based attachment position from the message-content response. Lets the server resolve Gmail's refreshed attachment IDs against current metadata before every download, selecting the current attachment ID, filename and MIME type.
user_google_emailYesThe user's Google email address. Required.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.30.1
    • changedInput schema / properties / attachment_index / description
      Previous value: -"Zero-based attachment position from\nthe message-content response. When the cap is enabled, this lets\nthe server safely resolve Gmail's refreshed attachment IDs against\ncurrent metadata before downloading."New value: +"Zero-based attachment position from\nthe message-content response. Lets the server resolve Gmail's\nrefreshed attachment IDs against current metadata before every\ndownload, selecting the current attachment ID, filename and MIME type."
  2. Changed2 schema fields changedv1.28.0
    • removedInput schema / properties / attachment_index / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / attachment_index / type
      Added value: +"integer"
  3. Changed1 schema field changedv1.26.0
    • addedInput schema / properties / attachment_index
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Zero-based attachment position from\nthe message-content response. When the cap is enabled, this lets\nthe server safely resolve Gmail's refreshed attachment IDs against\ncurrent metadata before downloading."
      +}
  4. Addedv1.0.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=false, destructiveHint=false), and the description adds real value beyond them: mode-dependent return behavior (stdio file path vs HTTP temp URL valid for 1 hour) and the side effect of re-fetching message metadata. It clarifies the otherwise-surprising readOnlyHint=false by explaining it writes to disk.

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, front-loaded sentences with zero filler. The core action comes first, followed by mode-specific return behavior. Every sentence earns its place.

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 an output schema present, return values need not be explained, yet the description helpfully covers mode-dependent outputs. It is complete enough for correct invocation given 100% schema coverage and annotations; only user-facing routing guidance is missing.

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 fully documents all five parameters, making 3 the baseline. The description does not reference return_base64 or attachment_index directly, so it adds no meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Downloads an email attachment and saves it to local disk'), which is unambiguous. It does not, however, differentiate itself from close siblings such as get_gmail_message_content or download_chat_attachment, so an agent still has to infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no when-to-use vs alternative guidance and no exclusions. An agent is not told when to prefer this over reading the full message body or when attachment_index resolution is required, leaving routing to inference.

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