Skip to main content
Glama
mail-mcp

mail-mcp

by spencer-fs

read_attachment

Read-onlyIdempotent

Extracts text from text-like email attachments such as TXT, CSV, JSON, XML, calendar, and sanitized HTML; returns only metadata for other file types, indicating when saving is needed.

Instructions

Return the text of a text-like attachment (txt, csv, json, xml, calendar, HTML after sanitising). For other types it returns only the attachment's details; use save_attachment to write those to disk.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "folder": "<folder>",
      "uidvalidity": "<uidvalidity>",
      "uid": "<uid>",
      "part_id": "<part_id>"
    },
    "name": "read_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidYesThe message's uid from search_messages.
folderYesFolder name exactly as list_folders or search_messages returned it.
offsetNoStart this many characters in, to continue a long attachment.
part_idYesThe attachment's part_id from read_message.
max_charsNoMost characters to return (default 12000, at most 50000).
uidvalidityYesThe uidvalidity that search_messages returned for this folder.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered. The description adds behavior the annotations cannot convey: HTML is sanitised before return, and unsupported types degrade to metadata-only output instead of erroring — an important non-obvious trait. It stops short of describing pagination continuation across calls, which the schema carries instead.

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?

Two tight sentences with no filler; the primary capability is front-loaded and the fallback/alternative follows immediately. Nothing could be removed without losing routing information.

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?

For a six-parameter read tool with no output schema, the description covers both return modes and names the alternative for the unsupported case. The composition of the "attachment's details" fallback is left unspecified — the schema does not describe it either — which is a minor remaining gap.

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

Parameters3/5

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

Schema description coverage is 100%, with each of the six parameters documented in the schema including defaults and limits for max_chars and the purpose of offset. The description adds no parameter-level detail beyond what the schema already provides, so the baseline 3 applies.

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 opens with a specific verb and resource ("Return the text of a text-like attachment") and enumerates the supported formats (txt, csv, json, xml, calendar, sanitised HTML), so an agent knows precisely what it produces. It also distinguishes itself from the write-path sibling save_attachment, rather than leaving the discrimination to inference.

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?

It clearly states the conditional behavior: text-like types yield text, other types yield only attachment details, and save_attachment is the named alternative for writing non-text attachments to disk. What's absent is guidance on when to prefer this over read_message for inspecting a message body, but the alternative for the main branch point is explicit.

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