Skip to main content
Glama

gmail_get_attachment

Fetch a single attachment from a Gmail message by ID, saving it to your download folder or returning base64 data for quick access.

Instructions

Fetch one attachment from a Gmail message. Writes it into the account's download directory and returns the path (encoding: file, the default), or returns the bytes inline as base64 (encoding: base64, capped at 750 KB). Attachment ids come from the attachments array on gmail_read_message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesConfigured Gmail account alias, e.g. work, personal, support.
encodingNofile
messageIdYes
attachmentIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool writes to the account's download directory, returns a path by default, or returns base64 inline with a size cap. It also notes that attachment ids come from gmail_read_message. This is good behavioral disclosure for a fetch tool, though it doesn't mention error cases or what happens if the attachment is too large for base64.

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 sentences, each carrying distinct information: what it does, the two output modes with their trade-offs, and where attachment ids come from. No filler or repetition.

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 tool with no output schema and no annotations, the description covers the essential behavior: output format, encoding options, size cap, and input provenance. It could mention error handling or the exact download directory path, but those are minor gaps for an agent deciding whether and how to call it.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 25% (only 'account' has a description). The description compensates by explaining the 'encoding' parameter's two modes and the base64 size cap, and by pointing to gmail_read_message for attachmentId provenance. It doesn't add detail for messageId, but that parameter is self-explanatory given the tool name.

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 verb ('Fetch'), a specific resource ('one attachment from a Gmail message'), and the two output modes. It clearly distinguishes itself from sibling tools like gmail_read_message (which returns attachment ids) and drive_save_attachment (which handles Drive attachments).

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?

The description explains when to use it: after obtaining attachment ids from gmail_read_message. It also explains the encoding choice (file vs base64) and the 750 KB cap for base64. It doesn't explicitly name alternatives or exclusions, but the context is clear enough for an agent to select it appropriately.

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