Skip to main content
Glama

Mail: Empty folder except kept

mail_empty_folder_except
Destructive

Clear out a folder but keep what matters — 'empty the inbox except the urgent ones'. The folder is required and never defaulted. Starred mail is kept unless you say otherwise; keep_unread, keep_urgency, keep_category, keep_from and keep_since add more exemptions, and everything kept is reported so the exemption can be checked against the count. For an ordinary folder the rest is moved to Trash and can be brought back; for Trash or Spam it is erased, which is what emptying those means. permanent=true erases from any folder. Bounded by max_delete per call. 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": {
      "folder": "<folder>"
    },
    "name": "mail_empty_folder_except"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderYes
mailboxNo
keep_fromNo
permanentNo
keep_sinceNoYYYY-MM-DD
max_deleteNo
keep_unreadNo
keep_starredNo
keep_urgencyNo
keep_categoryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations by naming the exact disposition of data: moved to Trash and recoverable for ordinary folders, erased for Trash/Spam, erased anywhere with permanent=true. It also discloses the per-call bound (max_delete), that kept items are reported for verification, and the full two-step confirmation handshake (status='confirmation_required', action_id, plan_token, confirm_action). Nothing here contradicts destructiveHint=true; it substantiates it.

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?

Dense but well ordered: core behavior first, exemptions next, data-disposition next, then the confirmation protocol last. Given 10 parameters and a destructive write, nearly every clause earns its place; the promotional 'keep what matters' framing is the only slightly expendable wording.

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, confirmation-gated bulk operation with no output schema, the agent has what it needs: required input, default keep behavior, exemption levers, recoverability semantics, deletion cap, and the exact next step after a proposed call. The only missing piece is return-value shape on success, which is largely implied by 'everything kept is reported'.

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?

With only 10% schema description coverage across 10 parameters, the description carries most of the load and mostly succeeds: 'folder is required and never defaulted', starred kept by default unless stated, and the roles of keep_unread/keep_urgency/keep_category/keep_from/keep_since, permanent, and max_delete are all explained. The 'mailbox' parameter and the expected format of keep_from (addresses? domains?) get no coverage at all, leaving a real gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ('Clear out a folder') plus the defining twist ('but keep what matters'), with an example ('empty the inbox except the urgent ones') that makes the semantics unambiguous. It never names the sibling mail_empty_folder, so the differentiation from the plain empty tool is left implicit rather than explicit.

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?

The example use case anchors when to reach for this tool, and the description explains which exemptions to add ('keep_unread, keep_urgency, keep_category, keep_from and keep_since add more exemptions'). It stops short of stating when NOT to use it — e.g., 'use mail_empty_folder if nothing should be kept' — so the alternative routing is inferable but not spelled out.

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