Skip to main content
Glama

move_mail

Destructive

Moves Mail messages between mailboxes for archiving, filing, or refiling, with a dry-run preview enabled by default and backup plus undo for safe recovery.

Instructions

Move messages between Mail mailboxes — archive, file, or refile. DESTRUCTIVE but recoverable: every message's bytes are copied to a backup directory and its source mailbox is logged BEFORE anything moves, so mail_undo puts the batch back.

dry_run DEFAULTS TO TRUE — the preview reads Mail and reports, per id, whether it is actually present in from_mailbox. Pass dry_run=False to move. ids are RFC822 message-ids from a mail read, comma-separated; max 25 per call and the cap is not overridable. BOTH mailboxes are required and are address tokens. from_mailbox must be the folder value from the read that produced the ids, passed back VERBATIM (an opaque imap://<uuid>/<path> token, not a name to retype); a canonical name there is refused. to_mailbox may also be one of the canonical "inbox"/"sent"/"drafts"/"trash"/"junk", which files into the SOURCE message's own account (it names Mail's cross-account accessor, not one mailbox), so it is refused for an On My Mac source — that store has none of the five. A Gmail label folder is refused as either end (a move out of a label left a copy on device, so mail_undo cannot reverse a move into one), and a canonical to_mailbox is refused when the source account has Gmail label folders. Pass a folder url from mail_overview when in doubt. To archive, move into a mailbox named Archive — there is no separate archive tool. Cross-account moves are supported and leave exactly ONE copy (out of a Gmail label they do not, which is why a label is refused). Verification is by-ID (#206): each copy's internal reference must go dead after the move, and the destination's count of that Message-ID must rise — presence alone can't tell a landed copy from a pre-existing one. A Message-ID with several copies in the source gets every one of them moved; ok means every copy left. A per-id status reports what really happened rather than assuming success. If the call times out mid-batch, the error names the receipt — re-run the same batch, or mail_undo it. Returns {op, receipt, count, succeeded, targets, destination, backup_dir, undo} — keep receipt to undo the batch. Needs Automation access for Mail, plus Full Disk Access to locate each message's file for the backup.

Input Schema

NameRequiredDescriptionDefault
idsYes
dry_runNo
to_mailboxYes
from_mailboxYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.1

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, and the description aligns with them ('DESTRUCTIVE but recoverable') while adding genuine depth: bytes are backed up and the source logged before anything moves, the 25-id cap is not overridable, cross-account moves leave one copy while label moves are refused, and Automation plus Full Disk Access are required. The only miss is that permission/keychain failure modes beyond the timeout path are not described.

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 destructiveness, and almost every sentence carries an operational constraint that would otherwise cause a failed call. It is nonetheless a dense wall of text with mild redundancy between the Gmail-label-refusal sentence and the later restatement, which costs it the top mark.

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?

Output schema exists so return values need not be explained, yet the description still lists them and tells the agent to keep `receipt` for undo, plus documents per-id `status`, the timeout/receipt recovery path, and the required system permissions. Nothing an agent needs to invoke this safely and correctly is missing.

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%, so the description must carry the full burden and does: `ids` are RFC822 message-ids, comma-separated, max 25; `dry_run` defaults true; `from_mailbox` must be the verbatim opaque imap:// token from the originating read and a canonical name is refused; `to_mailbox` accepts canonical accessors with a documented On My Mac and Gmail-label refusal. That is far more than the bare types in the schema.

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?

Opens with a specific verb and resource ('Move messages between Mail mailboxes — archive, file, or refile') and immediately distinguishes itself from siblings by noting 'there is no separate archive tool' and pointing at mail_undo as the reversal path. An agent can tell this apart from trash_mail or delete_draft without opening a schema.

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?

Explicit about when this is the right tool (archiving by moving into an 'Archive' mailbox), about the default preview behavior ('dry_run DEFAULTS TO TRUE … Pass dry_run=False to move'), when to consult mail_overview, and when to re-run vs. call mail_undo after a timeout. Refusal cases are enumerated rather than left to discovery.

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