Skip to main content
Glama
gmail-mcp

gmail-mcp

download_attachment

Downloads a file attachment from a Gmail message and saves it to a local path, creating parent directories and avoiding overwrites with counter suffixes.

Instructions

Download a file attachment from an email and save it to a local path.

Required:
  message_id (str) — Gmail message ID from list_emails.
  attachment_id (str) — attachment ID from list_attachments.
  save_path (str) — local file path to save to. Must be inside
    your home directory or the gmail-mcp config directory.
    Parent directories are created automatically.
    If the file already exists, a counter suffix is added
    (e.g. "report (1).pdf") to avoid overwriting.

Returns on success:
  {"filename": "report.pdf", "path": "C:/Users/.../report.pdf",
   "size": 204800}

Workflow note: Paths are validated — path traversal attempts
  (e.g. "../../etc/passwd") are rejected. Use absolute paths
  or paths relative to your home directory. Supported file
  types: any MIME type. Max attachment size: 25MB.

Input Schema

NameRequiredDescriptionDefault
save_pathYes
message_idYes
attachment_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does substantial work: it discloses path-traversal rejection, home/config-directory containment, automatic parent-directory creation, non-destructive collision handling via counter suffix, a 25MB size cap, and the exact success payload shape. It omits authentication/permission requirements and any failure-mode behavior (e.g. what happens when the attachment exceeds 25MB or the path is rejected).

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?

The one-line purpose is front-loaded, followed by a scannable Required/Returns/Workflow structure where every block earns its place. Slight redundancy in the path-safety message, which is stated once under save_path and again in the workflow note, keeps it from a 5.

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?

For a 3-required-param write-to-disk tool with no annotations and no output schema, the description covers return shape, size limit, supported types, and path safety — everything needed to call it correctly. The remaining gap is sibling disambiguation against `download_attachments` and any auth/sandbox prerequisites.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 compensate entirely, and it does: each of the three parameters is documented with its type, its provenance (Gmail message ID from list_emails, attachment ID from list_attachments), and for save_path the containment rule, directory-creation behavior, and collision-renaming convention. This is meaning well beyond the bare `{"type": "string"}` 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 ("Download a file attachment from an email and save it to a local path"), which is far more informative than the name alone. However, it never distinguishes itself from the sibling tool `download_attachments`, so an agent cannot tell from the description alone which of the two to pick for a single versus multiple attachment.

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?

Usage context is implied through the prerequisites — message_id "from list_emails" and attachment_id "from list_attachments" — which routes the agent through the correct discovery sequence. There is no explicit when-to-use/when-not statement and no mention of the plural `download_attachments` alternative for batch downloads, which is the main decision an agent faces here.

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