Skip to main content
Glama

Email: Get attachment

email_get_attachment
Read-onlyIdempotent

Retrieve one exact attachment from Gmail, Outlook/Microsoft or IMAP. Required chain: resolve/list email -> email_id -> read email -> attachment.id -> retrieve. Filename is NOT attachment_id. Email provider ID: Exact email ID returned by Nilyo/Unipile for the connected mailbox. On IMAP (and Exchange over IMAP) the ID encodes folder + UID: it CHANGES when the email is moved or a draft is updated; always reuse the id returned by the last operation. Obtain with: email_list_messages or email_list_folder_messages -> email.id; the id returned by email_move_or_label / email_update_draft after a change Never pass: RFC Message-ID unless a tool explicitly documents it, subject, an email_id captured before a move/update on IMAP. Attachment ID: Exact attachment id returned inside a specific email/message. Obtain with: read the parent email/message first -> attachment.id Never pass: filename, URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
email_idYesExact email provider ID from email list/read/resolve tools. Do not pass subject or RFC Message-ID unless a specific reply field explicitly asks for RFC Message-ID. Email provider ID: Exact email ID returned by Nilyo/Unipile for the connected mailbox. On IMAP (and Exchange over IMAP) the ID encodes folder + UID: it CHANGES when the email is moved or a draft is updated; always reuse the id returned by the last operation. Obtain with: email_list_messages or email_list_folder_messages -> email.id; the id returned by email_move_or_label / email_update_draft after a change Never pass: RFC Message-ID unless a tool explicitly documents it, subject, an email_id captured before a move/update on IMAP.
account_idNoOptional Nilyo connection ID (unipile_account_id from list_connected_accounts). Omit when the user has one account for this provider. When several exist, Nilyo never guesses: list them (display name, identifier, provider user ID), choose the one the user named or ask, and pass its ID here.
attachment_idYesExact attachment ID from the already-read parent email. Never use filename or URL as attachment_id. Attachment ID: Exact attachment id returned inside a specific email/message. Obtain with: read the parent email/message first -> attachment.id Never pass: filename, URL.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The annotations already mark this as read-only and idempotent, and the description adds critical behavioral context that the agent cannot infer: on IMAP the email ID changes when a message is moved or a draft is updated, so only the last-returned ID should be reused. This materially affects whether the call succeeds.

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 description is long but well structured with clear labels (Email provider ID, Attachment ID) and front-loads the purpose and required chain. Some content duplicates the schema parameter descriptions, so it is not optimally concise, but the organization makes it easy to scan.

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

Completeness5/5

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

For a three-parameter retrieval tool with no output schema, the description covers the prerequisites, provider-specific ID behavior, what not to pass, and how to obtain valid IDs. The optional account_id is fully documented in the schema, so nothing needed to call the tool correctly is missing.

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?

The schema already documents all three parameters fully, so the baseline is 3, but the description adds the explicit retrieval chain and the prohibition on using filenames, URLs, or RFC Message-IDs as IDs. That operational guidance clarifies the meaning of email_id and attachment_id beyond their schema descriptions.

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 opens with a specific verb and resource: 'Retrieve one exact attachment from Gmail, Outlook/Microsoft or IMAP.' It also states the exact input chain and explicitly warns that filename is not attachment_id, which distinguishes this from email_read_message and related email tools.

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?

It gives a clear when-to-use sequence: resolve/list email -> email_id -> read email -> attachment.id -> retrieve, and tells the caller what must be done before calling. It does not explicitly name alternative tools or say when not to use it, but the chain and 'Never pass' list provide strong usage constraints.

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.