Archive old notifications, newsletters, package updates and calendar replies
run_cleanupArchives 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
| Name | Required | Description | Default |
|---|---|---|---|
| inbox | No | Inbox name, inbox id, or leave empty for all inboxes | |
| dryRun | No | true to list what would be archived without archiving anything. | |
| confirmToken | No | When 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. | |
| staleUnreadDays | No | Also archive unread automated mail older than this many days. Off unless given. |