Skip to main content
Glama
gmail-mcp
by gchallen

search_threads

Read-only

Search Gmail conversations by query and labels, returning thread summaries without message bodies; use get_thread to read a specific thread.

Instructions

Search conversations (threads). Returns one row per thread: subject, snippet, participants, message count, last date, label IDs and message IDs, without bodies. Use get_thread to read one. Drafts-only threads are excluded unless the query mentions drafts. An empty list means nothing matched.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_threads"
  }
}

Input Schema

NameRequiredDescriptionDefault
viewNo"minimal" (default): thread summary. "metadata": summary without subject or snippet. "messages": also list each message's headers.
queryNoGmail search syntax, exactly as in the Gmail search box. Operators: from:, to:, cc:, bcc:, subject:, label:NAME, in:(inbox|sent|drafts|trash|spam|anywhere|archive), is:(unread|read|starred|important), has:attachment, filename:pdf, after:YYYY/MM/DD, before:YYYY/MM/DD, newer_than:7d, older_than:1y, larger:10M, "exact phrase", OR, -negation, ( ) grouping, {a b} for OR. Whitespace is AND. Keep queries keyword-based rather than pasting whole subjects.
labelIdsNoRestrict to threads carrying all of these label IDs.
pageTokenNonextPageToken from a previous call, to fetch the next page.
maxResultsNoThreads per page. Default 20.
includeSpamTrashNoInclude Spam and Trash. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.2

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare this as a read-only, open-world, non-destructive operation, and the description adds genuine behavioral context beyond that: bodies are omitted, drafts-only threads are silently filtered out, and an empty list is a legitimate no-match rather than an error. Pagination behavior is left implicit and handled only by the schema's pageToken field.

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?

Four short sentences, front-loaded with purpose and return shape, then routing advice, then edge-case semantics (drafts exclusion, empty list). No filler and nothing repeated from the schema.

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 no output schema, the description carries the burden of describing return values and does so field by field, while the fully documented input schema covers the six parameters. For a search tool with complex query syntax, the description plus schema leave nothing an agent needs to know before calling it.

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%, including a detailed enumeration of Gmail query operators and the view enum, so the schema carries parameter meaning on its own. The description adds only the behavioral note about drafts and the query, not syntax or format detail beyond the schema; baseline 3 applies.

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?

States a specific verb+resource ('Search conversations (threads)') and immediately defines the return shape: one row per thread with subject, snippet, participants, message count, last date, and label/message IDs, without bodies. It explicitly distinguishes itself from get_thread, so an agent can route without opening either schema.

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?

Names the follow-up alternative ('Use get_thread to read one') and gives a concrete scope rule that drafts-only threads are excluded unless the query mentions drafts, plus the meaning of an empty result. It lacks an explicit statement of when a broad message-level search would be preferable, but the guidance present is clear and actionable.

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