Change messages
update_messagesModify mail in one account in bulk: mark read/unread, star, move, archive, label, add/remove keywords, or trash, then report which IDs succeeded or failed.
Instructions
Change mail of one account: mark read or unread, star, move, archive, label, add and remove keywords, or put into the trash. Where a mail can be in several folders at once, add_folders puts it in one more and leaves it where it is, remove_folders takes it out of one, and remove_folders inbox archives it. Ids stay the same after a move. trash moves mail to the trash and deletes nothing for good. Answers which ids were done and which failed, with the reason.
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_id": "<account_id>",
"message_ids": "<message_ids>"
},
"name": "update_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trash | No | Into the trash, alone and without other changes | |
| unread | No | true: mark unread. false: mark read | |
| move_to | No | Folder id, or a role such as archive, inbox, junk. Not drafts | |
| starred | No | true: star. false: take the star off | |
| account_id | Yes | The account, by the id list_accounts names | |
| add_folders | No | Folder ids or roles. Only where a mail can be in several folders at once | |
| message_ids | Yes | Mails of that account, by the ids search_messages answers | |
| add_keywords | No | Keywords: a word of your own, or a mark among the account's marks_written, such as $junk | |
| remove_folders | No | Folder ids or roles. Only where a mail can be in several folders at once | |
| remove_keywords | No | Keywords: a word of your own, or a mark among the account's marks_written, such as $junk |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| done | Yes | ||
| failed | Yes |