Skip to main content
Glama
SantosRojas

Gmail Secure MCP

by SantosRojas

gmail_get_attachment

Read-onlyIdempotent

Download a Gmail attachment as base64 without saving it to disk, using message ID and filename to locate the part and enforcing size limits.

Instructions

Downloads a Gmail attachment as base64 without writing it to disk. Locates the part by filename within the message (Gmail attachment IDs are ephemeral and cannot be reused across calls). Refuses payloads over MAX_ATTACHMENT_BYTES. Attachment bytes are untrusted external content.

Input Schema

NameRequiredDescriptionDefault
filenameYesExact attachment filename from gmail_get_thread_summary
mime_typeNoDisambiguate when several parts share a filename
message_idYesGmail message ID holding the attachment
part_indexNo0-based index among same-filename matches (e.g. repeated invite.ics)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: base64-in-memory (no disk write), a hard refusal above MAX_ATTACHMENT_BYTES, and an explicit untrusted-content warning. Annotations only say read-only/idempotent; the description supplies the size ceiling, the failure mode, and the security posture an agent needs.

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?

Four short sentences, each carrying unique information: mechanism, lookup strategy, size guard, safety note. The key constraints are front-loaded with no filler.

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 no output schema, the description correctly states the return form (base64), which is the critical completeness item. Minor gap: MAX_ATTACHMENT_BYTES is named but not quantified, and there's no mention of response shape/size expectations.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning by explaining the lookup is by filename and why (ephemeral attachment IDs), which justifies the filename/mime_type/part_index triad instead of an ID parameter. It does not add syntax or format detail beyond that.

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?

States a specific verb and resource ('Downloads a Gmail attachment') and immediately distinguishes itself with the delivery mechanism ('as base64 without writing it to disk'). An agent can tell this apart from gmail_get_message_details or gmail_export_message without opening any schema.

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?

Gives clear operating context: the part is located by filename, and Gmail attachment IDs are ephemeral and cannot be reused across calls, which tells the agent not to cache IDs. It lacks an explicit when-not/alternatives statement (e.g. versus export_message), so it stops short of a 5.

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