bulk_update_flags
Update flags on multiple messages simultaneously using UIDs or search criteria. Add or remove system flags and custom keywords in one operation.
Instructions
Add or remove flags on multiple messages in one operation. Provide EITHER uids OR match, plus at least one of flagsToAdd / flagsToRemove. Same flag whitelist as update_message_flags.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Folder containing the messages (default: INBOX). | INBOX |
| uids | No | Explicit UIDs to update, scoped to `folder`. Mutually exclusive with `match` — provide exactly one. | |
| match | No | Search criteria selecting the messages to update (same fields as search_messages). Mutually exclusive with `uids`. | |
| flagsToAdd | No | Flags to add across all selected messages. System flags include the backslash (e.g. ["\\Seen"]); user keywords are bare (e.g. ["Important"]). At least one of flagsToAdd/flagsToRemove must be non-empty. | |
| flagsToRemove | No | Flags to remove across all selected messages (e.g. ["\\Seen"] to mark unread). | |
| dryRun | No | When true, preview the exact UIDs that would be updated without changing any flags. Run this first for match-based selections. |