Skip to main content
Glama
ni-c

imap-mcp

by ni-c

List or download attachments

get_attachments
Read-only

Lists email attachments with type, size, and fetch permission, then retrieves selected files — inline for small text/images or saved to disk for larger ones.

Instructions

Without part_id: lists the attachments of a message with their type, size and whether the policy allows fetching them. With part_id: returns that one attachment. Small text and images come back inline so you can read them; anything larger is written to the download directory and you get the path. part_id must come from a listing call of this same tool. Executables are refused even when they claim to be something else — including when writing to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID of the message, as returned by the listing tools.
modeNo"auto" (default) reads small text and images inline and saves the rest to disk; "inline" always returns the content; "file" always saves it.
mailboxNoMailbox (folder) name exactly as returned by list_mailboxes, e.g. "INBOX" or "INBOX/Archive". Defaults to the configured mailbox.
part_idNoMIME part id from a previous listing call. Omit to list the attachments.
Behavior5/5

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

The description goes well beyond the readOnlyHint annotation by disclosing that small text/images are returned inline, larger payloads are written to the download directory with a path, and executables are refused even if disguised. It also mentions policy constraints on whether fetching is allowed. This gives an agent important behavioral context that annotations alone do not capture.

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?

The description is compact and front-loaded: it explains both modes first, then behavior, then the source of part_id, then the safety constraint. Every sentence adds useful information without padding or repetition. It earns its length.

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 tool with no output schema, the description adequately covers what the agent will receive: attachment metadata when listing, inline content for small text/images, or a file path for larger files. It also covers policy restrictions, executables, and the required provenance of part_id. Nothing essential appears to be 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 input schema already documents all four parameters with 100% coverage, so the baseline is 3. The description adds meaningful value by explaining that part_id must originate from the same tool's listing call and by clarifying the mode behavior tied to auto/inline/file. This is helpful context 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 distinguishes the tool from siblings by specifying two modes: listing the attachments of a message without part_id and retrieving a single attachment with part_id. It names the resource (attachments of a message) and the verbs (list/returns), and its sibling relationships are obvious from context. This is more specific than the title and leaves no ambiguity about what the tool does.

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 gives explicit in-tool usage guidance: omit part_id to list, provide part_id to fetch a specific attachment, and part_id must come from a prior listing call of this same tool. It does not explicitly mention alternative tools such as get_message for reading message content, but the mode-based instructions are clear enough for an agent to select and invoke the tool correctly.

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/ni-c/imap-mcp'

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