Skip to main content
Glama

get_thread

Read-only

Fetch a Gmail thread by ID to read headers, plaintext and HTML bodies, and attachment metadata; set full:false for a headers-and-labels lookup when only metadata or authentication matters.

Instructions

Fetch a thread by ID: headers, plaintext + HTML bodies, and attachment metadata. full defaults to true and should stay true whenever content matters. full: false is a headers-and-labels fetch for when a thread is too large to read or only its metadata is of interest — it does NOT fetch bodies or attachment metadata, and the result then omits plaintextBody, htmlBody and attachments entirely and sets metadataOnly: true. The fields are omitted rather than empty on purpose: an empty attachment list from a request that never looked is indistinguishable from a message that truly has none, and treating it as 'no attachment' has already nearly caused an invoice to be archived as attachment-less. If search reported hasAttachments: true, or the sender matters, use full: true. EVERY MESSAGE CARRIES authentication — SPF/DKIM/DMARC as the RECEIVING server reported them, for answering 'is this mail really from who it says?'. That holds on a full: false fetch too — the metadata request asks for Authentication-Results by name, so checking whether a mail is really from who it says never costs a body. Read dmarc first: it is the only one of the three that ties a passing check to the visible From domain, so spf: pass alone proves nothing about the sender the user sees (a lookalike domain gets that trivially). signedBy/mailedBy/headerFrom name the domains each check actually validated. They do NOT have to match each other or the From address, and a mismatch is not by itself suspicious: a forwarded message legitimately shows the forwarder in mailedBy (the envelope sender is rewritten in transit) and in signedBy (the forwarder signs with its own key), while only headerFrom still names the original sender — which is exactly why dmarc is the result that carries meaning. Read those three as the explanation of a result, not as a test of their own. dkimAligned says whether a passing DKIM signature belongs to the From domain or a parent or child of it; it is absent when that cannot be told without a public-suffix list (two sibling subdomains), so a missing field is not a mismatch. authservId says WHO asserts all this: a message can carry forged Authentication-Results headers of its own, and only Gmail's own report (mx.google.com) is ever read; otherReports counts the reports that were NOT read, and alsoReported lists results that disagree with the ones above. unchecked: true means the message carried no report from Gmail — that is 'nobody looked', NOT 'nothing wrong'; unauthenticated does not imply forged, and authenticated does not imply honest (a phisher can hold a passing DMARC on his own lookalike domain). USE WHEN: reading a thread's content after finding it via search. DO NOT USE: with a message ID — this takes thread IDs. SIDE EFFECTS: none (does not mark as read).

Input Schema

NameRequiredDescriptionDefault
fullNo
threadIdYes

Output Schema

NameRequiredDescriptionDefault
messagesYes
threadIdYes
metadataOnlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.23.0
    • addedOutput schema / properties / messages / items / properties / authentication / properties / dkimAligned
      Added value: +{
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changedv0.17.0
    • addedOutput schema / properties / messages / items / properties / authentication
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "alsoReported": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "authservId": {
      +      "type": "string"
      +    },
      +    "dkim": {
      +      "type": "string"
      +    },
      +    "dmarc": {
      +      "type": "string"
      +    },
      +    "headerFrom": {
      +      "type": "string"
      +    },
      +    "mailedBy": {
      +      "type": "string"
      +    },
      +    "otherReports": {
      +      "type": "integer"
      +    },
      +    "returnPath": {
      +      "type": "string"
      +    },
      +    "signedBy": {
      +      "type": "string"
      +    },
      +    "spf": {
      +      "type": "string"
      +    },
      +    "unchecked": {
      +      "const": true,
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedOutput schema / properties / messages / items / required
      Previous value: -[
      -  "id",
      -  "threadId",
      -  "labelIds",
      -  "from",
      -  "to",
      -  "subject",
      -  "date",
      -  "snippet"
      -]New value: +[
      +  "id",
      +  "threadId",
      +  "labelIds",
      +  "from",
      +  "to",
      +  "subject",
      +  "date",
      +  "snippet",
      +  "authentication"
      +]
  3. Changed2 schema fields changedv0.15.1
    • changedOutput schema / properties / messages / items / required
      Previous value: -[
      -  "id",
      -  "threadId",
      -  "labelIds",
      -  "from",
      -  "to",
      -  "subject",
      -  "date",
      -  "snippet",
      -  "plaintextBody",
      -  "htmlBody",
      -  "attachments"
      -]New value: +[
      +  "id",
      +  "threadId",
      +  "labelIds",
      +  "from",
      +  "to",
      +  "subject",
      +  "date",
      +  "snippet"
      +]
    • addedOutput schema / properties / metadataOnly
      Added value: +{
      +  "const": true,
      +  "type": "boolean"
      +}
  4. First observedv0.1.8

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover readOnlyHint/openWorldHint, and the description adds substantial context beyond them: no side effects (does not mark as read), the exact fields omitted under `full: false` and why they are omitted rather than empty (with a concrete near-miss anecdote), `metadataOnly: true`, and the deliberate design rationale. It also explains the failure mode of treating a missing attachment list as 'no attachment'.

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?

Front-loading is excellent — purpose, then the `full` semantics, then auth interpretation, then USE/DO NOT USE. But roughly two thirds of the text is a deep tutorial on SPF/DKIM/DMARC interpretation, `authservId`, `alsoReported` and `unchecked`, which is return-value interpretation for a tool that already ships an output schema. For a 2-parameter fetch this is heavily over-sized.

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?

For a two-parameter read tool with an output schema, nothing an agent needs is missing: identity of the ID type, the `full` trade-off, the omission convention, and the read-only guarantee are all stated. The auth prose is redundant with the output schema rather than a gap.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden — and does. `full` is given its default, its semantic difference (headers/labels only), the fields it drops, and the flag it sets; `threadId` is disambiguated from message IDs. No parameter is left to inference.

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?

Opens with a specific verb+resource+payload: 'Fetch a thread by ID: headers, plaintext + HTML bodies, and attachment metadata.' Immediately separates itself from search_* siblings by requiring a thread ID and pointing back to search for discovery.

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?

Explicit USE WHEN ('reading a thread's content after finding it via search') and DO NOT USE ('with a message ID — this takes thread IDs'). It also gives a decision rule for the `full` flag: stay true when content matters, false only when the thread is too large or metadata-only is of interest, plus the `hasAttachments: true` trigger.

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