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?

With annotations already declaring readOnlyHint=true, idempotentHint=true, and destructiveHint=false, the description adds crucial behavioral nuance: it explains that on IMAP (and Exchange over IMAP) the email ID encodes folder+UID and changes when the email is moved or a draft is updated, so the last returned ID must always be used. It also clarifies that filenames are not valid IDs. This is beyond what annotations convey and is essential for correct invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is verbose and repetitive. The same warnings about never passing filename/URL and about IMAP ID changes are duplicated for both email_id and attachment_id. The text is not front-loaded; it mixes critical guidance with redundancy. It could be condensed by half without losing information, and the structure (a single long paragraph) makes it hard to scan quickly.

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?

The description covers the required chain, ID stability pitfalls, and sources for both IDs, which is comprehensive for the main flow. However, it does not mention the account_id parameter (though the schema covers it with its own guidance) and does not state what the tool returns (e.g., binary data or a URL). Since there is no output schema, a brief note on return type would make it fully complete. Still, given the tool name and context, the missing info is minor.

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

Parameters5/5

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

Schema description coverage is 100%, so the baseline is 3, but the description enriches both key parameters with explicit acquisition instructions: email_id via email_list_messages/email_list_folder_messages or from email_move_or_label/email_update_draft after a change, and attachment_id from reading the parent email first. It also lists what to never pass (filename, URL, subject, RFC Message-ID). This substantially exceeds the schema's bare definitions.

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 ('Retrieve'), resource ('attachment'), and scope ('from Gmail, Outlook/Microsoft or IMAP'), and explicitly defines the required chain (resolve/list email -> email_id -> read email -> attachment.id -> retrieve). This clearly distinguishes it from siblings like email_read_message, which fetches the message body, not the attachment. No ambiguity remains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives an explicit step-by-step usage chain and explicitly warns against passing filenames, URLs, or RFC Message-ID, and against reusing stale IMAP IDs after moves/updates. It even names the source tools (email_list_messages, email_list_folder_messages) and the post-change IDs to reuse, leaving no doubt about when and how to call this tool. This exceeds the typical 'when to use' guidance.

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.