bulk_set_flags
Batch set or remove IMAP flags on multiple messages, reducing API requests compared to per-message flag changes.
Instructions
Set or clear IMAP flags on multiple messages in a single operation.
More efficient than looping set_flags: one UID STORE per chunk of ~500 UIDs, not one per message. Validates every flag the same way set_flags does (rejects flags with whitespace, parens, etc.).
Args: folder: Folder containing the messages email_ids: List of UIDs to update add: Flags to add (e.g. ["\Seen"]) remove: Flags to remove
Returns count of UIDs touched per add/remove operation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"folder": "<folder>",
"email_ids": "<email_ids>"
},
"name": "bulk_set_flags"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | Yes | ||
| email_ids | Yes | ||
| add | No | ||
| remove | No |