manage_trash
Move emails to trash, permanently delete, or empty the trash. Use dry-run mode to preview changes before applying.
Instructions
Manage trash operations - delete emails or empty trash.
When dry_run=True (default) and action is "move_to_trash", previews what would be deleted without acting. Set dry_run=False to actually move to trash.
Args: account: Account name (e.g., "Gmail", "Work") action: Action to perform: "move_to_trash", "delete_permanent", "empty_trash" subject_keyword: Optional keyword to filter emails (not used for empty_trash) subject_keywords: Optional list of subject keywords; matches any keyword sender: Optional sender to filter emails (not used for empty_trash) mailbox: Source mailbox (default: "INBOX", not used for empty_trash or delete_permanent) max_deletes: Maximum number of emails to delete (safety limit, default: 5) confirm_empty: Must be True to execute "empty_trash" action (safety confirmation) apply_to_all: Must be True to allow operations without subject_keyword or sender filter older_than_days: Optional age filter - only affect emails older than N days dry_run: If True (default), preview what would be affected without acting
Returns: Confirmation message with details of deleted emails
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | ||
| action | Yes | ||
| subject_keyword | No | ||
| subject_keywords | No | ||
| sender | No | ||
| mailbox | No | INBOX | |
| max_deletes | No | ||
| confirm_empty | No | ||
| apply_to_all | No | ||
| older_than_days | No | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |