Update thread labels
cooper_update_threadUse this when every message in a conversation should gain or lose the same labels, including marking the thread read, or when the thread should move to inbox, archive, spam, or trash. Requires auth. Works on a paused inbox. Inputs: inbox_id (required; inbox id, username, or email), thread_id (required), add_labels (optional strings), remove_labels (optional strings), folder (optional; inbox, archive, spam, or trash), block_sender (optional boolean; only with folder spam). The label change is applied to every message in the thread. read and unread can be changed. Other system labels (inbox, sent, untrusted, auth_failed, owner, and SPF/DKIM/DMARC results) cannot. Moving to the same folder twice changes nothing and emits no event. Moving to inbox removes the folder row. Trash sets purge_after to 30 days after the move. block_sender adds the latest inbound From address to the inbox receive block list and returns blocked_sender. Returns the thread plus messages_updated, and blocked_sender when block_sender was true. The thread includes assignment, folder, and purge_after. Unknown thread returns HTTP 404 thread_not_found. Invalid labels return invalid_label, protected_label, or label_conflict. A bad folder returns invalid_folder. block_sender without folder spam returns invalid_block_sender.
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": {
"inbox_id": "<inbox_id>",
"thread_id": "<thread_id>"
},
"name": "cooper_update_thread"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Move the thread to inbox, archive, spam, or trash. inbox removes the folder row. The same folder twice is a no-op. A bad value returns invalid_folder. | |
| inbox_id | Yes | Inbox id (inb_…), username, or full email address owned by this key | |
| thread_id | Yes | Thread id (thr_…) whose messages should change labels | |
| add_labels | No | Labels to add on every message. read and unread are allowed. System labels are not. | |
| block_sender | No | When true, and only with folder spam, add the thread's latest inbound From address to the inbox receive block list. Returns blocked_sender. Without folder spam this returns invalid_block_sender. | |
| remove_labels | No | Labels to remove from every message. Pass ["unread"] to mark the thread read. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Thread id (thr_…). | |
| folder | No | inbox, archive, spam, or trash. | |
| labels | No | Labels on the object. | |
| preview | No | Preview of the latest message. | |
| senders | No | Addresses that sent mail on this thread. | |
| sent_at | No | ISO-8601 time of the latest outbound message, or null. | |
| subject | No | Subject of the first message. | |
| inbox_id | No | Inbox id (inb_…) this object belongs to. Null when it applies to every inbox. | |
| assignment | No | Current assignment {assignee, note, claimed_until, claim_active, …}, or null. | |
| created_at | No | ISO-8601 time the object was created. | |
| recipients | No | Addresses that received mail on this thread. | |
| updated_at | No | ISO-8601 time the object last changed. | |
| purge_after | No | ISO-8601 time a trashed thread is deleted, or null. | |
| received_at | No | ISO-8601 time of the latest inbound message, or null. | |
| message_count | No | Number of messages on the thread. | |
| blocked_sender | No | The block-list entry created when block_sender was true. | |
| last_message_id | No | Id of the newest message. | |
| attachment_count | No | Number of attachments across the thread. | |
| messages_updated | No | How many messages changed. |