Skip to main content
Glama

getThread

Retrieve an email thread by ID to read its messages as cleaned text, headers only, or raw MIME. Control quoted history, per-body and total size limits, and fetch only the latest messages or specific IDs.

Instructions

Get a specific thread by ID. 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 returns raw MIME trees with decoded text bodies limited by maxBodyChars. Use maxMessages (latest N) or messageIds to fetch only the messages you need. Note: maxBodyChars caps each message body independently, not the total response size. maxResponseChars bounds the aggregate response and truncates (keeping the latest messages) with a truncationNote when the thread is too large.

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": {
      "id": "<id>"
    },
    "name": "getThread"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe ID of the thread to retrieve
formatNoResponse format for each message: clean (default), metadata (headers only), or full (raw MIME tree)clean
messageIdsNoOnly include messages with these IDs in the thread response. An empty array is treated as no filter.
maxMessagesNoOnly include the latest N messages of the thread (applied after messageIds). Omit for all. 0 or a negative value means unlimited. Fractional values are floored. Use 1-2 for the usual 'just the latest reply' case.
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
maxResponseCharsNoWhole-response character budget across all messages combined (unlike maxBodyChars, which only caps each message independently). When exceeded, the oldest messages are dropped (keeping the latest) and the response reports responseTruncated/totalMessages/includedMessages/truncationNote. Default 100000. 0 = unlimited.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses truncation semantics (oldest messages dropped, latest kept, truncationNote emitted), that ambiguous Outlook-style quotes are left in the body and flagged rather than guessed, and that oversized undecoded parts are omitted with a totalChars note. Missing only auth/permission expectations and error behavior for a nonexistent ID.

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

Conciseness4/5

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

Front-loaded with purpose and mode behavior, then progressively narrower details. It is dense but every sentence carries information; the only mild waste is restating the maxBodyChars semantics that the schema also documents.

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 8-parameter read tool with no output schema, the description covers the return-shape signals an agent needs (flags and truncation notes) and the mode tradeoffs. Error handling for an invalid thread ID and whether clean mode falls back to HTML-only bodies are the remaining unstated cases.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it clarifies that maxBodyChars caps each message independently rather than the whole response, contrasting it with maxResponseChars, and explains the practical rationale for includeQuoted. This removes a genuine ambiguity the schema alone would leave.

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?

States a specific verb and resource ('Get a specific thread by ID') and immediately explains the two response modes (clean vs full), so the agent knows the tool's core behavior. It does not distinguish itself from siblings like getMessage or batchGetThreads, so the agent must infer that this is the single-thread fetch.

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 clear in-tool selection guidance: use maxMessages or messageIds to limit fetched messages, use includeQuoted when quotedHistoryAmbiguous repeatedly appears, and understand that clean mode is the default. It never states when to choose this tool over getMessage or batchGetThreads, which is the one gap.

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