Skip to main content
Glama
flt-sudo

gmail-mcp-server

by flt-sudo

Get Gmail thread

gmail_get_thread
Read-onlyIdempotent

Fetch a full Gmail thread by ID, returning every message with headers, body text, and attachment metadata.

Instructions

Fetch a full thread — every message with normalized headers and body text.

Args:

  • thread_id (string, required): from gmail_search_threads. Thread ids are ACCOUNT-SPECIFIC — pass the same 'account' the id came from.

  • account (string, optional): email or alias. Omit for the default account.

  • response_format: 'markdown' (default) or 'json'.

Returns: all messages in the thread (from/to/cc, date, subject, labels, body text, attachment metadata). Long threads are truncated to fit the response limit, with a note saying how many messages were shown; use gmail_get_message for a specific message's full content.

Examples:

  • {"thread_id": "18c2f5a7b3d9e1f0"}

  • {"thread_id": "18c2f5a7b3d9e1f0", "account": "work", "response_format": "json"}

Error Handling: a 404 usually means the id belongs to a DIFFERENT account — check the 'account' field on the search result that produced the id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoEmail or alias of the account to use. Omit to use the default account. Call gmail_list_accounts if unsure.
thread_idYesGmail thread id (account-specific).
response_formatNoOutput format: 'markdown' for compact human-readable rendering (default), 'json' for the full normalized structure.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds meaningful behavioral context: truncated long threads with a note on message count, normalized headers/body, and a 404 failure mode tied to account mismatch. This goes well beyond what the annotations alone provide.

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

Conciseness5/5

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

The description is well-structured with front-loaded purpose, then Args, Returns, Examples, and Error Handling. Each section earns its place, and the content is detailed without being bloated or repetitive.

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?

Since there is no output schema, the description properly explains return values: all messages with headers, body text, labels, and attachment metadata. It also covers truncation behavior and the likely 404 cause, so an agent has everything needed to invoke and interpret the tool correctly.

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 actionable context: thread_id must come from gmail_search_threads and be used with the same account that produced it. The examples also clarify realistic invocation patterns, which exceeds the baseline without being redundant.

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 description opens with a specific verb and resource: 'Fetch a full thread — every message with normalized headers and body text.' It also distinguishes itself from siblings by stating it retrieves the complete thread and explicitly pointing to gmail_get_message for a specific message's full content.

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?

It clearly establishes when to use this tool: to get an entire thread. It also gives an explicit alternative condition, 'use gmail_get_message for a specific message's full content,' and explains that thread_id comes from gmail_search_threads. It doesn't contrast with every sibling, but the routing guidance is sufficient.

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