Skip to main content
Glama
sethbang

proton-mail-mcp

download_attachment

Idempotent

Download an email attachment by specifying its part number. Retrieve the content as base64 or write it to a file for offline access.

Instructions

Download an email attachment by part number. Use read_message or list_attachments first to see available attachments and their part numbers. By default returns base64-encoded content inline (read-only). When saveTo is provided AND the ALLOW_FILE_DOWNLOAD_DIR env var is set, this tool WRITES the decoded bytes to that path inside the allowlist root and returns the file path + size instead of base64 (avoids blowing the token budget on large attachments) — that write is the only side effect, and it is why this tool is not marked read-only. Inline (no saveTo) calls do not touch the filesystem. Re-running with the same arguments is idempotent (overwrites the same file with identical bytes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesMessage UID
folderNoFolder containing the message (default: INBOX)INBOX
partNumberYesMIME part number of the attachment (from read_message output)
saveToNoOptional relative path inside ALLOW_FILE_DOWNLOAD_DIR to write the decoded attachment to. Rejects absolute paths, `..` traversal, and symlink escapes. Requires ALLOW_FILE_DOWNLOAD_DIR to be set in the environment.
Behavior5/5

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

Discloses side effects: file write only when saveTo provided, otherwise read-only. Explains idempotency and security checks. Aligns with annotations and adds context.

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?

Concise and well-structured. Front-loaded action, then prerequisites, then behavior details. No superfluous information.

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?

Covers all aspects: two modes, prerequisites, security, idempotency, and no output schema needed.

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?

Input schema covers all params with descriptions. Description adds important context: saveTo triggers file write, security constraints, and inline behavior.

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?

Clear verb 'Download' and specific resource 'email attachment by part number'. Distinguishes from siblings like list_attachments and read_message.

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?

Explicitly states to use read_message or list_attachments first to get part numbers. Explains two modes (inline vs saveTo) and when each applies. No explicit exclusions but strong guidance.

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/sethbang/proton-mail-mcp'

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