listThreads
Retrieve and filter mailbox threads by query or labels, fetch bodies in clean or full mode, and cap body and response size to keep results manageable.
Instructions
List threads in the user's mailbox. Clean mode removes quoted reply history when it can be safely identified; an ambiguous Outlook-style quote (no ">" prefixes to mark where it ends) is left in the body rather than guessed at, and flagged via quotedHistoryAmbiguous/quotedHistoryNote. Full mode limits decoded text bodies with maxBodyChars. Omit format to get bare thread stubs. maxResponseChars bounds the aggregate response size across all fetched threads combined and truncates (dropping the lowest-priority threads, then oldest messages within a thread) with a truncationNote when the call is too large.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "listThreads"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Only return threads matching the specified query | |
| format | No | When set, auto-fetches full thread details. metadata=headers only (default when set), clean=with bodies, full=raw MIME tree. | |
| labelIds | No | Only return threads with labels that match all specified label IDs | |
| pageToken | No | Page token to retrieve a specific page of results | |
| maxResults | No | Maximum number of threads to return | |
| maxMessages | No | Only include the latest N messages per thread. Omit for all. 0 or a negative value means unlimited. Fractional values are floored. | |
| maxBodyChars | No | Max decoded chars per text body — per message in clean mode, per MIME text part in full mode; not a whole-response cap. Oversized undecoded parts (e.g. HTML) are omitted with a totalChars note. 0 = unlimited. | |
| includeQuoted | No | In clean mode: skip quote detection entirely and always return the full body, including any quoted reply history. Default false. Use this if quotedHistoryAmbiguous keeps showing up and you'd rather have the full text every time than a per-message flag. | |
| includeBodyHtml | No | In full mode only: whether to include parsed HTML body parts | |
| includeSpamTrash | No | Include threads from SPAM and TRASH | |
| maxResponseChars | No | Whole-response character budget across every thread this call fetches combined (unlike maxBodyChars, which only caps each message independently, and applies per-thread besides). When exceeded, whole threads are dropped from the end of the list first; each retained thread is also capped individually. Reports responseTruncated/totalThreads/includedThreads/truncationNote at the top level, and the same per-thread when an individual thread's messages were cut. Default 100000. 0 = unlimited. |