Restore a thread from the trash
threads_untrashBring one thread, or one message of it, back out of the trash. A Gmail connected by Google sign-in brings it back with every label it carried. A Gmail mailbox whose provider is imap puts a draft back in its drafts, the owner's own mail in sent mail and the rest in the inbox, with every label it carried, each message keeping its id. An Outlook mailbox and any other mailbox whose provider is imap put a message threads_trash moved there back in the folder that move took it from - the latest such move, within 30 days, while that folder is still there outside the trash - and any other message by that same rule; each message they bring back names the folder it went to as restoredTo, and in a mailbox whose provider is imap the new id it took. With ids in place of id it takes 2 to 100 at once under one call's time, counted as one action: each thread it reached is answered under threads - done; notDone, saying why; or possiblyDone, moved in part or asked with no answer back, which threads_get - or messages_get for a message - reads to check - and each it did not reach, its time spent, its connection lost or the mailbox refusing it whole, is left untouched under notReached, for the same call again.
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": {
"mailbox": "<mailbox>"
},
"name": "threads_untrash"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The threadId a search or a read answered, or with scope message the message's id. | |
| ids | No | 2 to 100 threadIds - or with scope message message ids - in place of id, acted on in one call. | |
| scope | No | thread, the default, acts on the whole thread; message acts on that one message alone. | |
| mailbox | Yes | The mailbox's name or its email address. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| threads | No | Each thread the call reached, with ids. | |
| labelIds | No | ||
| messages | No | ||
| newestOnly | No | The folders whose provider showed only their newest messages, each with how many it showed: every one holds more, and nothing before those was read, searched, counted or acted on, so finding nothing there says nothing of the rest. | |
| notReached | No | The ids the call did not reach - its time ran out, its connection to the mailbox was lost, or the mailbox refused it whole, as the thread that met the refusal says - each left untouched, for the same call again. |