Skip to main content
Glama

Read a Gmail attachment

read_gmail_attachment
Read-only

Open one attachment of a Gmail message and return what is in it. Text, CSV, JSON, HTML and code files come back as themselves; images come back as pictures the assistant can look at (a large photo, or a HEIC or TIFF, is scaled down to a JPEG; images up to 25 MB); a PDF comes back whole as a document (an embedded application/pdf resource) for the assistant to read. Word documents (.docx) come back as their text. Spreadsheets can't be read here — but any attachment can be saved as-is with save_gmail_attachment_to_drive. Other attachments up to 10 MB. Get attachmentId from get_gmail_message or get_gmail_thread.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mailbox": "<mailbox>",
      "messageId": "<messageId>",
      "attachmentId": "<attachmentId>"
    },
    "name": "read_gmail_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
mailboxYesEmail address of the connected Gmail/Google Workspace mailbox to act on. Call list_authorized_mailboxes to see available options.
messageIdYes
attachmentIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, destructiveHint=false and openWorldHint=false, but the description goes well beyond them: 25 MB image cap, 10 MB cap for other attachments, HEIC/TIFF downscaling to JPEG, .docx flattened to text, and PDFs returned as an embedded application/pdf resource. Those transformations and limits are exactly the behavior an agent cannot infer from structured fields.

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?

Purpose is front-loaded in the first clause, and every subsequent clause carries a distinct operational fact (type handling, size caps, the spreadsheet exclusion, the id source). It is dense but the semicolon-and-parenthetical packing makes it slightly harder to scan than a short bulleted enumeration would.

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?

There is no output schema, so the description carries the full burden of describing returns, and it does so thoroughly by file type. What is missing relative to a 3-param, no-output-schema tool is error behavior (size-limit failures, unsupported types) and any note on what the response envelope looks like beyond the embedded PDF resource.

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 coverage is only 33% — mailbox is documented in the schema, but messageId and attachmentId have no schema descriptions. The description partially compensates by naming the tools that yield an attachmentId, but says nothing about messageId (whether it is the Gmail message id, a thread id, or a hex id).

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 ('Open one attachment of a Gmail message and return what is in it') and enumerates exactly what comes back per file type. The Gmail scoping, plus the explicit contrast with save_gmail_attachment_to_drive, lets an agent distinguish it from the Outlook/AgentMail and Drive-reading siblings without opening a 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 a clear exclusion ('Spreadsheets can't be read here') with the correct alternative named (save_gmail_attachment_to_drive), and states where the required attachmentId comes from (get_gmail_message or get_gmail_thread). It stops short of telling the agent when to prefer a different mail-provider reader or when saving-then-reading is better for unsupported types.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources