Skip to main content
Glama

export_mail

Exports selected mail messages as importable .eml files directly from disk, without launching Mail or using Automation, so you can archive or open them elsewhere.

Instructions

Write messages out as importable .eml files (Full Disk Access).

Read AT REST — the same on-disk bytes the undo backups copy — so this never launches Mail and needs no Automation. ids are RFC822 message-ids from a mail read, comma-separated, max 25. dest_dir must be inside the allowed root (~/Downloads by default; MACOS_APPS_FILE_ROOT moves it) and is created if needed; a path outside it is REFUSED. Filenames are derived, never overwritten. A name that already exists refuses the whole batch before any file is written; a refusal after a write names the files already written.

.eml is the only format — it is lossless and opens in Mail and everything else, and mail_body already covers "give me the text".

Returns {results, written, dest_dir, plane}. A message with no local file is reported per-id as status: "absent" rather than failing the batch. fidelity: "partial" means the .eml is missing its ATTACHMENT payloads — the body is complete (#119). It is lossy for archival, not for reading. Additive: writes new files, never overwrites or modifies mail.

Input Schema

NameRequiredDescriptionDefault
idsYes
dest_dirYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.1

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that it reads at rest and never launches Mail or needs Automation, requires Full Disk Access, refuses paths outside the allowed root, derives filenames on a never-overwrite basis, and aborts the whole batch before writing if a name collides. It also explains partial-fidelity attachment loss and per-id 'absent' handling — exactly the behavioral context an agent needs before a write.

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 the core action, then constraints, then return shape — a logical order with almost no filler. It is dense and multi-paragraph for a 2-param tool, so slightly heavier than strictly necessary, but each sentence adds operational value.

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?

Covers the failure semantics (batch refusal, per-id absent, partial fidelity) that matter for a batch write, and an output schema already exists so return values are doubly covered. Minor gap: it does not state what happens on a mid-batch I/O error beyond the 'files already written' note, or whether there is rate limiting on Full Disk Access reads.

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

Parameters5/5

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

Schema coverage is 0%, and the description fully compensates: `ids` is documented as comma-separated RFC822 message-ids (from a mail read) capped at 25, and `dest_dir` as being constrained to the allowed root, defaulting to ~/Downloads, relocatable via MACOS_APPS_FILE_ROOT, and auto-created. This is strictly more information than the bare string-typed schema carries.

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 — 'Write messages out as importable .eml files' — and immediately distinguishes itself from the sibling mail_body ('mail_body already covers "give me the text"'). An agent can tell exactly what this produces without opening the schema.

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?

Explicitly routes the text-only case to mail_body and frames this as the archival/export path, plus notes the max-25 batch limit and the allowed-root requirement. It stops short of naming other export siblings (export_photo, save_mail_attachment) as alternatives, so selection against the full sibling set is slightly under-specified.

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