Skip to main content
Glama

Archive old notifications, newsletters, package updates and calendar replies

run_cleanup

Archives duplicate automated notifications (keeps the newest), calendar replies older than 5 days, unread newsletters older than the person's newsletter age (default 14 days), and shipping updates for orders that have since been delivered (the Delivered message stays), with one undo for the whole run. Never touches VIP, starred, snoozed or suspicious mail, anything waiting on a reply or already replied to, or mail from a person. Only archives when the person turned on cleanup (update_triage_profile defaults.cleanup.auto); otherwise it lists what it would archive. Call it from a routine on the person's cadence. Say nothing when it archived nothing. Also archives unread automated mail older than staleUnreadDays, but only when that input is given. More than 25 messages returns a preview with a confirmToken first and archives nothing; ask the person, then repeat the call with it. Work on your own only on a clear instruction or a saved agentRules rule.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run_cleanup"
  }
}

Input Schema

NameRequiredDescriptionDefault
inboxNoInbox name, inbox id, or leave empty for all inboxes
dryRunNotrue to list what would be archived without archiving anything.
confirmTokenNoWhen a run would archive more than 25 messages, the first call returns a preview and archives nothing; repeat the same call with its confirmToken after the person agrees.
staleUnreadDaysNoAlso archive unread automated mail older than this many days. Off unless given.

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 mark this as not read-only, not idempotent, not destructive, and open-world, but the description adds substantial context beyond them: one undo covers the whole run, VIP/starred/snoozed/suspicious/waiting-on-reply/person mail is never touched, the Delivered message is preserved, and cleanup only auto-archives when the profile setting is enabled. It also discloses that large runs return a preview and archive nothing until confirmed.

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 core archiving scope is front-loaded, and every clause carries operational meaning about exclusions, gating, preview flow, or autonomy. The long multi-clause sentence with nested parentheticals is dense and could be organized more cleanly, but it is not padded with 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 complex multi-category cleanup tool with no output schema, the description covers the crucial behavioral edges: what is archived, what is protected, when it runs automatically, when it only previews, how confirmation works, undo support, and silent no-op behavior. An agent has enough information to invoke it correctly.

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 description coverage is 100%, so the schema already documents inbox, dryRun, confirmToken, and staleUnreadDays thoroughly. The description reinforces the confirmToken workflow and notes that staleUnreadDays is off unless provided, but it does not add meaning beyond the schema and does not mention the inbox parameter.

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 states a specific verb (archives) and enumerates the exact resources and conditions: duplicate notifications, old calendar replies, unread newsletters, shipping updates, and stale unread automated mail. It clearly distinguishes this broad cleanup routine from the narrower archive_messages sibling by describing automated category-based archiving with exclusions.

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 explicitly says when to call it (from a routine on the person's cadence), when not to act autonomously (only on clear instruction or a saved agentRules rule), and what to do when cleanup is disabled (list what would be archived). It also gives escalation guidance for the >25 message preview and says to stay silent when nothing was archived.

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