Skip to main content
Glama

mail_delete_messages

Destructive

Move specific iCloud Mail messages to Trash by UID, keeping them recoverable; permanently delete from Trash only when permanent deletion is enabled.

Instructions

Move specific messages, by uid, to Trash, where they stay recoverable; deleting permanently from Trash only works if the operator allowed it.

Use when: the owner asks to delete particular messages you found. Not for all messages matching a filter (use mail_run_bulk_action with action trash, which previews and can be undone), for filing elsewhere or into Junk (use mail_move_messages), or for flags (use mail_mark_messages). Parameters: uids and uidvalidity must come from the same mail_search_messages (or mail_get_messages) result for folder. folder is an exact name from mail_list_folders or an alias (INBOX, Sent, Drafts, Trash, Junk, Archive). Behavior:

  • Confirm with the owner first.

  • From any folder but Trash, each message is copied to Trash and removed from its folder by its own uid; nothing else is touched, and it can be restored with mail_move_messages.

  • When folder is Trash, the messages are deleted for good only if ALLOW_PERMANENT_DELETE is on (off by default); otherwise the call is refused and nothing changes.

  • A renumbered folder is refused before anything moves. Returns: {moved_to_trash, from, trash}, or {permanently_deleted, folder}, each listing the uids. Errors: 'Messages in Trash are not permanently deleted' (they are already in Trash; leave them), out-of-date uids (search again), or a partial stop saying how many already moved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidsYesMessage uids in that folder (from mail_search_messages).
folderYesMail folder, e.g. INBOX, Sent, Archive or a custom name.
uidvalidityYesThe 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "mail_delete_messagesDictOutput",
      -  "type": "object"
      -}New value: +null
  2. Addedv0.12.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, but the description adds substantial context beyond them: it requires owner confirmation, explains the copy-to-Trash-then-remove mechanics, restoration via mail_move_messages, the ALLOW_PERMANENT_DELETE gate (off by default) that refuses rather than misbehaves, renumbering refusal, and the partial-stop error behavior.

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?

Front-loaded with the core action, then cleanly sectioned into Use when / Parameters / Behavior / Returns. Dense but every sentence carries operational information (gating, errors, restore path), so nothing is wasted.

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?

Although there is no output schema, the description documents the return shapes ({moved_to_trash, from, trash} vs {permanently_deleted, folder}) and the error cases. For a 3-param destructive tool this is fully sufficient for correct invocation.

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 baseline is 3. The description goes beyond the schema by stating that uids and uidvalidity must originate from the same mail_search_messages/mail_get_messages result for the folder, and enumerating folder aliases (INBOX, Sent, Drafts, Trash, Junk, Archive), which is genuine added meaning.

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+resource with scope: 'Move specific messages, by uid, to Trash'. It immediately clarifies the recoverability semantics and distinguishes itself from sibling tools (mail_move_messages, mail_run_bulk_action, mail_mark_messages) so an agent can route correctly without opening any 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 'Use when' clause plus a 'Not for...' clause naming three alternatives with the exact condition that selects each (bulk filtered delete, filing elsewhere/Junk, flags). Nothing about when to prefer this vs alternatives is left to inference.

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