Skip to main content
Glama

Mail attachments

mail_attachments

List a mail's attachments, read text from a selected PDF, DOCX, PPTX, XLSX, or text file, or save all attachments and inline images to a directory.

Instructions

List a mail's attachments, read the text of one (read), or save them all (save_to).

Attachment text is wrapped in UNTRUSTED markers. A saved image can be opened as a file to look at it.

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": {
      "mail_ref": "<mail_ref>"
    },
    "name": "mail_attachments"
  }
}

Input Schema

NameRequiredDescriptionDefault
readNoReturn the text of this attachment (1-based number or file name). Works for PDF, DOCX, PPTX, XLSX and text files.
inlineNoAlso list and save inline images (screenshots pasted into the text).
save_toNoDirectory to save all attachments into (Windows or /mnt/c/...).
mail_refYesMail ref from mail_find, e.g. 'm:7KQ2PXA'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.3
    • addedInput schema / properties / inline
      Added value: +{
      +  "default": false,
      +  "description": "Also list and save inline images (screenshots pasted into the text).",
      +  "title": "Inline",
      +  "type": "boolean"
      +}
  2. First observedv0.3.1

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the annotations, it discloses two non-obvious behaviors: extracted attachment text is wrapped in UNTRUSTED markers (a prompt-injection safety signal the agent must not treat as instructions), and a saved image can subsequently be opened as a file. It does not state what happens on name collisions during `save_to` or whether saving is additive, but the annotations already cover the write/safety profile.

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 tightly written sentences, with the mode overview front-loaded before the safety note. Nothing is redundant with the title or schema, and no sentence is padding.

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 4-parameter tool with full schema coverage and no output schema, the definition covers modes, the reference format dependency, and the untrusted-content caveat. The only meaningful gap is what the default listing returns (names, sizes, indices) and how `inline` interacts with the listing, which the description leaves implicit.

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 parameter descriptions already document formats and defaults. The description still adds value by framing `read` and `save_to` as alternative modes ('read the text of one, or save them all') rather than independent flags, which the schema does not make obvious.

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 states a concrete verb and resource ('List a mail's attachments') and enumerates the three operating modes, tying two of them to the exact parameter names `read` and `save_to`. An agent can immediately tell this apart from `mail_read` or `mail_thread`, which operate on message bodies rather than attachments.

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 distinguishes the three invocation modes: default listing, single-attachment text extraction via `read`, and bulk persistence via `save_to`. It does not explicitly exclude alternatives or say when to prefer `mail_read` for body text, so it falls short of full when/when-not guidance.

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