Skip to main content
Glama

Gmail Get Thread

gmail_get_thread
Read-onlyIdempotent

Retrieves a Gmail conversation by thread ID, returning the newest cleaned message with earlier-message summaries or raw thread data in full, metadata, or minimal formats.

Instructions

Read one Gmail conversation by thread ID. The default format 'clean' gives the newest message with its cleaned body plus a one-line summary of each earlier message; 'full', 'metadata' and 'minimal' return Gmail's raw thread resource instead. Use gmail_read_emails to read particular messages in full or continue a truncated body, and gmail_search_emails (group_by_thread=true lists conversations) to find threads. Returns thread_id, count (messages in the thread) and either latest, prior_messages and account_timezone ('clean') or thread (the other formats, whose historyId is Gmail's).

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": {
      "thread_id": "<thread_id>"
    },
    "name": "gmail_get_thread"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNo'clean' (default): latest is the newest message's summary plus its cleaned body text, paged at about 8,000 characters (continue with gmail_read_emails and offset=next_offset), and prior_messages gives from, date, subject and snippet of each earlier message. The others return Gmail's raw thread resource under thread: 'full' with every message's headers and base64url-encoded body parts, 'metadata' with headers only, 'minimal' with IDs and labels only.clean
thread_idYesGmail thread ID, from the thread_id field of Gmail search, digest and read results.

Output Schema

NameRequiredDescriptionDefault
countNoNumber of items in this response.
latestNo
threadNo
has_moreNoWhether another page is available.
thread_idNo
fetched_atNoRFC3339 time when this response was fetched.
prior_messagesNo
next_page_tokenNoOpaque token for the next page, or null.
account_timezoneNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and openWorld, so safety is covered; the description goes further by disclosing the ~8,000-character paging behavior, the offset=next_offset continuation path, and how the four formats differ in payload. It does not discuss auth or rate limits, but for a read-only tool that is a minor omission.

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?

Three sentences, front-loaded with purpose then alternatives, with no filler. The closing enumeration of returned fields (thread_id, count, latest, prior_messages, account_timezone) is somewhat redundant against the existing output schema and slightly bloats an otherwise tight definition.

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

Completeness5/5

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

With only two parameters, full schema coverage, and an output schema present, the definition supplies everything an agent needs: what it reads, which format to pick, how truncation works, and which sibling to fall back to. Nothing material is missing for correct invocation.

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 coverage is 100% and the format enum's own description already explains each mode in detail, so the description's format discussion largely restates structured data. It adds only the framing that 'clean' is the default and that prior_messages carries from/date/subject/snippet, which is modest added value at the baseline level.

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

Purpose5/5

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

The first sentence gives a specific verb and resource ('Read one Gmail conversation by thread ID') and immediately scopes the default behavior via the 'clean' format. It also contrasts itself with gmail_read_emails and gmail_search_emails, so an agent can distinguish this tool from its siblings without opening any schema.

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

Usage Guidelines5/5

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

It states explicit routing rules: use gmail_read_emails for full message bodies or to continue a truncated body, and gmail_search_emails with group_by_thread=true to find threads. Both the when-to-use and the alternative-selection condition are spelled out rather than implied.

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