Bulk clean-up with preview
bulk_cleanupArchive, mark as read, label, or trash every email matching a search in one Gmail account. Preview matches first with a dry run, then confirm to apply the action safely.
Instructions
Archive, mark as read, label, or move to Trash every email matching a search in one account. ALWAYS two steps: first call with dryRun=true (default) to get a preview and a confirmToken, show the preview to the user, and only after they agree call again with the same arguments, dryRun=false and that confirmToken. Archive / mark read / label need drafts mode; trash needs full mode (recoverable for 30 days in Gmail).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max | No | At most this many emails (default 200; trash max 500). | |
| label | No | For action "label": label name to add. | |
| query | Yes | Search selecting the emails, e.g. "from:newsletter@shop.gr older_than:30d". | |
| action | Yes | ||
| dryRun | No | Preview only (default true). | |
| account | No | Account alias or email address. Omit to use the default account. No accounts connected yet. | |
| confirmToken | No | Token from the preview; required when dryRun=false. |