get_thread
Read an entire email conversation from a single message, ordered oldest first. Gather replies from all folders via All Mail search, returning message IDs and optional trimmed bodies.
Instructions
Read a whole conversation from one of its messages, oldest first. Returns each message's envelope and message_id, and with include_bodies a shortened body for each. A conversation is usually split across folders, with your own replies in Sent, so pass the All Mail folder as search_folder to gather all of it. Use the returned uid and uidvalidity with get_email for a message in full.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | message uid from list_emails or search_emails | |
| folder | Yes | folder name, as returned by list_folders | |
| uidvalidity | Yes | uidvalidity value returned alongside the uid; detects stale uids | |
| search_folder | No | folder to gather the conversation from; defaults to folder. Pass the All Mail folder to include replies filed elsewhere, such as your own in Sent | |
| include_bodies | No | also return each message's body, trimmed far shorter than get_email returns |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | messages in the conversation before the return limit | |
| folder | Yes | folder the conversation was gathered from; the uids below belong to it | |
| messages | Yes | oldest first | |
| returned | Yes | ||
| uidvalidity | Yes | generation of folder, to pass alongside a uid |