Skip to main content
Glama

List a message's attachments

list_attachments
Read-onlyIdempotent

Lists a message's attachments with index, filename, type and size without downloading or marking it read; use the indexes to read, save, forward, or attach files.

Instructions

List one message's attachments with their index, filename, type and size; downloads nothing and marks nothing read.

Use it first whenever a tool needs an attachment index: read_attachment, save_attachment, forward_message and create_draft's attachment_indexes all take the index it returns, counted from 1. To read an attachment's content, use read_attachment next; message_id is the one search_mail or read_thread returned.

Reads that one message with read_thread's bounds. size is the transfer-encoded byte count, as size_note says, so base64 files show about a third larger than their decoded bytes. A filename is the sender's choice, with invisible characters shown as "_"; it is null for an unnamed part.

Returns attachments (index, filename, type, size) and size_note. An incomplete lookup refuses and can be retried; an unknown Message-ID refuses.

Input Schema

NameRequiredDescriptionDefault
message_idYesThe message's RFC Message-ID, as search_mail returns it, such as <a@example.test>. Not an IMAP UID.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: nothing is downloaded or marked read, the lookup shares read_thread's bounds, size is the transfer-encoded byte count so base64 parts appear ~33% larger, filenames may contain invisible characters rendered as '_' or be null, and failure modes are spelled out (incomplete lookup refuses and is retryable; unknown Message-ID refuses).

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?

Front-loaded with purpose and the index-first routing, then details on size semantics and failure modes. Dense but mostly earning its place, though explaining return values the output schema already covers is slightly redundant.

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?

Even though an output schema exists, the description covers the practical gaps: index base, size encoding caveats, filename quirks, and refusal/retry behavior. An agent can invoke it correctly and interpret surprises without opening anything else.

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 the baseline is 3, but the description adds provenance the schema does not: message_id is the value returned by search_mail or read_thread, and returned indexes are counted from 1. That meaningfully reduces mis-supplied IDs.

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?

States a specific verb and resource ('List one message's attachments') and enumerates the returned fields (index, filename, type, size). It also distinguishes itself from the sibling read_attachment, which fetches content rather than the list.

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?

Explicitly says 'Use it first whenever a tool needs an attachment index' and names the four consumers (read_attachment, save_attachment, forward_message, create_draft's attachment_indexes). It also directs the agent to read_attachment next for content, so the when/when-not boundary is clear.

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