delete_emails
Move emails matching filters (subject, sender, or age) to Trash. Dry-run by default to preview changes before actual deletion.
Instructions
Soft-delete emails (move to Trash) matching filters, with safety features.
IMPORTANT: dry_run=True by default -- shows what WOULD be deleted without acting. Set dry_run=False to actually move emails to Trash.
At least one filter (subject_keyword, sender, or older_than_days) is required. Emails are moved to Trash, never permanently deleted.
Args: account: Account name (e.g., "Gmail", "Work") subject_keyword: Optional keyword to filter emails by subject sender: Optional sender email/name to filter by older_than_days: Only affect emails older than N days mailbox: Source mailbox to search in (default: "INBOX") max_emails: Maximum number of emails to delete (safety limit, default: 25) dry_run: If True (default), only preview what would be deleted
Returns: List of affected email subjects and count
User Preferences: {"workflow": "default", "notifications": "enabled"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sender | No | ||
| account | Yes | ||
| dry_run | No | ||
| mailbox | No | INBOX | |
| max_emails | No | ||
| older_than_days | No | ||
| subject_keyword | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |