Skip to main content
Glama

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

NameRequiredDescriptionDefault
qNoOnly return threads matching the specified query
formatNoWhen set, auto-fetches full thread details. metadata=headers only (default when set), clean=with bodies, full=raw MIME tree.
labelIdsNoOnly return threads with labels that match all specified label IDs
pageTokenNoPage token to retrieve a specific page of results
maxResultsNoMaximum number of threads to return
maxMessagesNoOnly include the latest N messages per thread. Omit for all. 0 or a negative value means unlimited. Fractional values are floored.
maxBodyCharsNoMax 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.
includeQuotedNoIn 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.
includeBodyHtmlNoIn full mode only: whether to include parsed HTML body parts
includeSpamTrashNoInclude threads from SPAM and TRASH
maxResponseCharsNoWhole-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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does substantial work: it discloses that clean mode removes quoted reply history, that ambiguous Outlook-style quotes are deliberately left in place rather than guessed at, and that the condition is surfaced via quotedHistoryAmbiguous/quotedHistoryNote. It also explains truncation ordering (lowest-priority threads dropped first, then oldest messages) and the truncationNote signal. It omits access/permission requirements and pagination behavior, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, which is good, but everything after is a single dense run-on paragraph mixing mode semantics, quote handling, and two separate size caps. Some sentences duplicate schema content almost verbatim, and the reader has to parse clause-heavy text to extract the actionable rules.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, zero-annotation, no-output-schema listing tool, the description covers the decisions that matter: which format to request, how quote cleaning behaves, and how size limits and truncation are reported. Missing pieces are minor for a read-style listing tool — nothing on pagination flow beyond the pageToken parameter or on error conditions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 11 parameters in detail, establishing a baseline of 3. The description adds one genuinely new nuance — that omitting format yields bare thread stubs — and reinforces the maxResponseChars vs maxBodyChars distinction, but most of its parameter prose restates what the schema already says.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource ('List threads in the user's mailbox'), which is immediately actionable. The remainder explains the format modes rather than how this differs from siblings such as batchGetThreads or listMessages, so an agent gets a clear purpose but no explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete selection rules: 'Omit format to get bare thread stubs' for lightweight listing, clean mode for body content, full mode for raw text with maxBodyChars caps. It also tells the agent when to prefer includeQuoted ('Use this if quotedHistoryAmbiguous keeps showing up'), which is real conditional guidance. It stops short of saying when not to use this tool in favor of a named alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools