Skip to main content
Glama

Clean the filed mail of one sender

clean_filed_mail
Idempotent

Moves to the trash every email of one sender (an address, or @domain for a whole domain) that is already filed out of the inbox, in every connected mailbox, when it is noise, a notification or an automated alert. Because the sender is named, action words and known-contact status do not keep a mail; a protected category (a real conversation, a transaction, a legal notice) or a mail the user reclassified by hand still stays. The inbox is never touched, nor a mail the server still shows in the inbox. Returns how many were trashed, which were kept and why, how many are still in the inbox and how many were not found on the server. Never a permanent deletion; each email is undone by restore_to_inbox.

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": {
      "sender": "<sender>"
    },
    "name": "clean_filed_mail"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderNoOnly the mail filed in this folder (see list_folders).
senderYesAn email address, or @domain.com for every address of that domain.

Output Schema

NameRequiredDescriptionDefault
cleanupYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +{}
    • addedOutput schema / properties / cleanup / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. Added

TDQS

A4.2/5.0
Behavior3/5

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

The description goes well beyond the annotations by disclosing retention rules, the cross-mailbox scope, the inbox safety boundary, and the shape of the result summary. But it can be read as seating a bulk write under destructiveHint=false and idempotentHint=true without explaining why repeated runs are idempotent or how a partially failed run behaves. It adds real context above the annotation baseline but leaves the idempotency claim itself unevidenced in the text.

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?

The scope and safety constraints are front-loaded and every clause carries operative information about what is deleted versus kept. The middle sentences are long and clause-stacked, which costs some scan-ability, but no sentence is filler.

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 mutation tool with a 2-parameter schema and an existing output schema, the description still covers what the return summary contains, which mail survives, and how to reverse the action. Nothing an agent needs in order to call it safely is missing.

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

Parameters3/5

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

Schema coverage is 100%, so both parameters are already documented, and the description's '@domain for a whole domain' shorthand largely repeats the schema's own sender description. The optional folder parameter is never mentioned in the prose, so the description adds no meaning beyond the schema baseline.

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?

The description opens with a specific verb and resource ('Moves to the trash every email of one sender') and narrows scope precisely: already filed out of the inbox, across every connected mailbox. The sender syntax and the noise/notification qualifier make it distinguishable from a generic single-message trash_email or move_email 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the condition for use (sender is noise, a notification or an automated alert and the mail is already filed out of the inbox) and explicit exclusions (protected categories, hand-reclassified mail, anything still in the inbox are left alone). It also names the recovery path, restore_to_inbox, so the agent knows the alternative when undo is needed.

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.