batch-delete-messages
Remove up to 100 email messages at once by moving them to Trash. Get clear counts of deleted and failed messages plus failure reasons to verify the cleanup.
Instructions
Use when: deleting multiple messages in one call (1–100 ids; moves them to Trash). Returns: counts of how many were deleted and how many failed, plus the distinct reasons for any failures. Do not use when: deleting just one (use delete-message) or filing messages away (use batch-move-messages). Safety: destructive and applies to many messages at once — require explicit user confirmation, and search-messages/list-messages first to confirm every id is correct before deleting. Pass sourceMailbox/sourceAccount (the mailbox you listed the ids from) so each numeric id is pinned to that mailbox; an id that matches in several mailboxes is refused, not guessed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | ||
| sourceAccount | No | Account the numeric ids were listed from. Required when sourceMailbox is supplied; on its own it pins nothing. | |
| sourceMailbox | No | Mailbox the numeric ids were listed from (e.g. 'INBOX'). Must be paired with sourceAccount to form an unambiguous scope. Ignored for imap: ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| errors | No | ||
| failed | No | ||
| mailbox | No | ||
| success | No | ||
| countDelta | No | ||
| errorsTruncated | No |