Skip to main content
Glama

Mail: Delete messages

mail_delete_batch
Destructive

Delete messages you name by id — one call, one confirmation, however many ids. By default they go to Trash, which is reversible: they stay there until the Trash is emptied. Pass permanent=true to erase them from the server instead, with no undo and no second copy; that is the only way to erase mail that is not already in Trash, because an IMAP move gives the destination copy a new uid that nothing can address afterwards. Messages already sitting in Trash or Spam are reported back rather than moved again. Ids come from mail_list_messages or mail_get_cleanup_summary. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "message_ids": "<message_ids>"
    },
    "name": "mail_delete_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
permanentNo
message_idsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description adds substantial context beyond them: reversibility via Trash, the irrecoverable nature of permanent erasure, the IMAP uid rationale for why moves cannot be undone, and the fact that Trash/Spam items are reported rather than re-moved. It also discloses the full proposal/confirmation protocol (status='confirmation_required', action_id, plan_token, confirm_action), which is critical for a write tool.

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 behavior, then the confirmation protocol, with essentially no filler sentences. It is a dense single block, and the IMAP uid justification is slightly convoluted, but every clause carries information an agent needs.

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?

For a destructive, no-output-schema tool with 2 undocumented parameters, the description covers the safety profile, reversibility, edge cases (already-Trash/Spam items), id sourcing, and the confirmation handshake. An agent has everything needed to call it correctly and to interpret the proposed-action response.

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 description coverage is 0%, so the description must carry the load, and it does: it explains that permanent defaults to false, is irreversible, and is required for non-Trash mail, and it names where message_ids come from. It does not explain why ids accept both integers and strings (uid vs id form) or why the 500 cap exists, leaving one gap.

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 ('Delete messages'), the selection mechanism ('you name by id'), and the batch scope ('however many ids') in one sentence. The mention that ids come from mail_list_messages or mail_get_cleanup_summary implicitly separates it from filter-based deletion siblings.

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?

Gives clear when-to-use conditions: default path sends to Trash and is reversible; permanent=true is the only way to erase mail not already in Trash. It also routes the agent to where ids come from. It does not name overlapping siblings such as mail_delete_permanently or mail_delete_by_filter, so the agent must infer the boundary itself.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources