Skip to main content
Glama

gmail_download_attachments

Download Gmail attachments that match a search query into a destination directory, with collision-safe filenames and an optional filename or MIME type filter.

Instructions

Download attachments from messages matching a Gmail search query into a destination directory. Files are named <messageId>__<originalFilename> to avoid collisions. Returns a summary.

Input Schema

NameRequiredDescriptionDefault
emailNoGoogle account email. May be omitted when exactly one account is configured; required when multiple accounts are configured.
queryYesGmail search query (e.g. 'label:DMARC')
dest_dirYesAbsolute path to destination directory; created if missing
max_messagesNoDefault 200
filename_filterNoOptional case-insensitive substring matched against original filename
mime_type_filterNoOptional case-insensitive substring matched against MIME type

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the output naming scheme (`<messageId>__<originalFilename>`) and collision avoidance, but omits any statement about overwriting existing files, duplicate handling, size/rate limits, or whether the Gmail mailbox itself is left untouched (read-only side effects vs. disk writes).

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 core action and scope. The naming-convention detail and the return-value note both earn their place given there is no output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter write-to-disk tool with no annotations and no output schema, the description leaves gaps: the shape of the returned 'summary' is undefined, and side-effect semantics (overwrite, dedup) are unstated. Adequate but with clear holes.

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 all six parameters are already documented in the schema. The description adds no parameter-level detail (e.g., query syntax beyond the schema example, filter semantics, or max_messages defaults), so baseline 3 applies.

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 attachments from messages matching a Gmail search query into a destination directory') plus the naming convention used for output files. The purpose is unambiguous, but it does not distinguish itself from the nearby sibling gmail_bulk_export, which an agent may confuse it with.

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?

The description never says when to prefer this tool over alternatives such as gmail_search, gmail_get_message, or gmail_bulk_export. There is no mention of prerequisites (configured account), no exclusions, and no guidance on choosing between attachment-downloading flows.

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