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 attachment by providing its message ID and attachment ID, and receive a local file path or temporary download URL. Optionally return the attachment as base64 for direct use.

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. When the cap is enabled, this lets the server safely resolve Gmail's refreshed attachment IDs against current metadata before downloading.
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.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."
      +}
  2. Addedv1.0.1

TDQS

A4.3/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing that the attachment is written to local disk, that stdio versus HTTP returns different access mechanisms, that the HTTP URL is temporary and valid for one hour, and that metadata may be re-fetched to resolve filename and MIME type. This gives the agent meaningful behavioral expectations without contradicting any annotations.

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?

The description is compact, front-loaded with the core action, and every sentence earns its place: saving behavior, mode-specific return values, and metadata resolution are all covered in under 50 words. There is no filler or redundancy.

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?

Given the rich parameter schema, the presence of an output schema, and the annotations, the description covers the essential operational context: what happens to the file, how the agent accesses it in each mode, and the temporary nature of the HTTP URL. Nothing critical is missing for an agent to call the tool correctly.

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?

The input schema already documents every parameter with 100% coverage, so the description does not need to repeat parameter details. The description adds general behavioral context about metadata re-fetching and delivery modes, but it does not specifically enrich the meaning of individual parameters 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?

The description states a specific action ('Downloads an email attachment') and a concrete resource outcome ('saves it to local disk'), clearly distinguishing this tool from message-content and thread-content siblings. It also immediately clarifies the two delivery modes, so an agent knows exactly what this tool returns.

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

Usage Guidelines3/5

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

The tool's purpose makes its intended use reasonably evident, and the stdio/HTTP mode guidance helps the agent know what to expect. However, it does not explicitly say when to prefer this over siblings like get_gmail_message_content or download_chat_attachment, so the usage guidance is implied rather than stated.

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