Skip to main content
Glama
emperor-mail

emperor-mail

read_attachment

Read-only

Extract and read the text of a specific email attachment using its message UID and attachment index; returns metadata for unsupported file types.

Instructions

Read the text of one attachment of a message (text, HTML, PDF, DOCX, XLSX/XLS/ODS; other types return metadata only). Index comes from read_message.

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": {
      "uid": "<uid>",
      "index": "<index>"
    },
    "name": "read_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidYesUID from search.
indexYesAttachment index from read_message (starts at 0).
folderNoFolder holding the message (default INBOX).
max_charsNoMost characters to return (default 20000, at most 200000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / properties / folder / default
      Removed value: -null
    • changedInput schema / properties / folder / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
    • removedInput schema / properties / index / format
      Removed value: -"uint"
    • removedInput schema / properties / index / minimum
      Removed value: -0
    • removedInput schema / properties / max_chars / default
      Removed value: -null
    • removedInput schema / properties / max_chars / format
      Removed value: -"uint"
    • removedInput schema / properties / max_chars / minimum
      Removed value: -0
    • changedInput schema / properties / max_chars / type
      Previous value: -[
      -  "integer",
      -  "null"
      -]New value: +"integer"
    • removedInput schema / properties / uid / format
      Removed value: -"uint32"
    • removedInput schema / properties / uid / minimum
      Removed value: -0
  2. First observedv0.1.3

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered. The description adds genuinely useful behavior beyond that: unsupported MIME types degrade to metadata rather than failing, and only one attachment is processed per call. It does not mention truncation via max_chars or what happens on an out-of-range index, which the schema only partially covers.

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?

A single dense sentence with the resource and format scope front-loaded and no filler. The parenthetical is compact and earns its place by listing supported types.

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?

No output schema exists, and the description carries the essential return-value distinction: extracted text for supported formats, metadata only otherwise. For a read-only single-attachment extractor with fully documented parameters, this covers what an agent needs before calling.

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%, so all four parameters are already documented, including the 0-based index and the max_chars bounds. The description restates the index provenance but adds no format, default, or constraint detail beyond the schema — baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Read the text of one attachment of a message') and immediately scopes it to a single attachment, which implicitly separates it from read_message. The parenthetical enumerates the formats whose text is extracted, so an agent knows exactly what it gets back.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The prerequisite is stated ('Index comes from read_message'), which tells the agent it must fetch the message first. There is no explicit when-not guidance or named alternative, though the 'metadata only' caveat for unsupported types acts as an implied boundary.

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

Deploy Server

Other Tools