Skip to main content
Glama
chandshy
by chandshy

Download Attachment

download_attachment
Read-only

Retrieve the binary content of an email attachment as a base64-encoded string. First use get_email_by_id to list available attachments.

Instructions

Download the binary content of an email attachment as a base64-encoded string. Use get_email_by_id first to see available attachments and their indices (0-based). Provide the message folder to avoid a cross-folder UID collision; it is required for folder-restricted agents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoFolder the email lives in. Required for folder-restricted agents and recommended for all callers because IMAP UIDs are per-folder.
email_idYesIMAP UID of the email
account_idNoOptional account ID to route this call to (multi-account configs). Omit to use the active account. Configured account IDs are listed in the settings UI (Accounts tab).
attachment_indexYes0-based index of the attachment (from get_email_by_id attachments array)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes
contentYesBase64-encoded attachment content
encodingYes
filenameYes
contentTypeYes
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds the behavioral detail that the output is base64-encoded content and explains why folder is needed. It does not contradict annotations and provides clear context beyond annotations.

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, no fluff. The first sentence clearly states the purpose. Each sentence adds essential information: output format, prerequisite, and folder parameter guidance.

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?

The output schema exists (not shown but context indicates true), so return values are covered. The description explains the output format (base64), prerequisite step (get_email_by_id), and the folder parameter need. This is complete for a download tool.

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 baseline is 3. The description adds value by cross-referencing get_email_by_id for attachment_index, explaining the rationale for folder, and clarifying account_id optionality. It provides meaning beyond the 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 clearly states the tool downloads binary content as base64-encoded string. It specifies the resource (email attachment) and the output format, and distinguishes from siblings by mentioning the prerequisite use of get_email_by_id to locate 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 explicitly instructs to use get_email_by_id first to see attachments and indices. It also explains the folder parameter requirement for folder-restricted agents and the cross-folder UID collision reason. However, it does not discuss alternative tools or when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chandshy/mailpouch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server