Skip to main content
Glama

gmail_search_threads

Search Gmail threads in a connected account using query syntax to find messages by sender, subject, attachment, label, or date.

Instructions

Search email threads using Gmail query syntax (e.g. "from:amy has:attachment newer_than:7d").

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": {
      "account": "<account>"
    },
    "name": "gmail_search_threads"
  }
}

Input Schema

NameRequiredDescriptionDefault
viewNoTHREAD_VIEW_MINIMAL (default) includes subject and snippet; THREAD_VIEW_METADATA_ONLY omits them.
queryNoGmail search query. Supports from:, to:, subject:, has:, label:, is:, before:/after:YYYY/MM/DD, newer_than:/older_than:, OR, and - to exclude. Omit to list everything except spam and trash.
accountYesWhich connected account (alias) to act as, e.g. "business".
pageSizeNoMaximum results to return. Defaults to 20, maximum 50.
pageTokenNoToken from a previous call, to fetch the next page.
includeTrashNoInclude threads from Spam and Trash. Defaults to false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses almost nothing: it never states that this is a read-only operation, that results are paginated, that Spam and Trash are excluded by default, or that an account alias must be connected. 'Search' weakly implies a non-mutating read, but that is inference, not disclosure.

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?

One sentence, front-loaded with the action and resource, with a single example that earns its place by demonstrating the query dialect. No hedging or filler.

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

Completeness3/5

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

For a six-parameter search tool with a required account parameter and no output schema, the definition is minimal but the schema compensates on parameter detail. Missing are the behavioral facts an agent would want before calling: read-only nature, pagination via pageToken, and default Spam/Trash exclusion.

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 every parameter including query operators, view modes, pageSize caps, and includeTrash is already documented in structured form. The description's example query largely restates what the query parameter description already lists, adding no new syntax or constraint detail.

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 description has a specific verb ('Search') and resource ('email threads'), and it identifies the query dialect (Gmail query syntax) plus a concrete example. That is enough to distinguish it from gmail_get_thread or gmail_get_message, even though no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: the query-syntax example suggests how to scope a search, but the description never says when to choose this over gmail_get_thread or gmail_list_drafts, nor does it mention required prerequisites such as a connected account. The schema's 'omit to list everything' note is the closest thing to guidance, and it lives in the schema rather than the description.

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