Mark or label messages
update_messagesMark messages read or unread, star or unstar them, and add or remove labels across Gmail and IMAP mailboxes in a single call of up to 100 message IDs.
Instructions
Mark messages read or unread, star or unstar them, and add or remove labels (Gmail user labels; IMAP keywords). Flags: UNREAD, STARRED. At most 100 ids per call; each id gets its own result. Labels must already exist on Gmail. IMAP keywords with junk or spam in the name ($Junk, $NotJunk) train spam filters and need the delete permission. Changes can be undone with the opposite call (spam-filter training cannot). To move, archive or trash, use move_messages.
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": {
"account": "<account>",
"ids": "<ids>"
},
"name": "update_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Message ids of this mailbox (from search_messages or get_message). | |
| account | Yes | Mailbox alias or email address from list_accounts. | |
| add_flags | No | Flags to set (UNREAD marks unread, STARRED stars). | |
| add_labels | No | Labels (Gmail) or keywords (IMAP) to add, at most 20. | |
| remove_flags | No | Flags to clear (removing UNREAD marks read). | |
| remove_labels | No | Labels (Gmail) or keywords (IMAP) to remove, at most 20. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed | No | ||
| account | No | ||
| results | No | ||
| succeeded | No |