Skip to main content
Glama
gmail-mcp
by gchallen

search_messages

Read-only

Find individual Gmail messages with one row per result, returning headers, snippets, and labels. Use it to get a specific message ID for replying, forwarding, labeling, or fetching attachments.

Instructions

Search individual messages rather than threads: one row per message with headers, snippet and labels. Better than search_threads when you need a specific message ID (to reply, forward, label or fetch attachments) or a date-ordered list.

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_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
formatNoPer-message detail. Default "minimal" (no bodies). "plain_text" fetches bodies too: slower and larger.
labelIdsNoRestrict to messages carrying all of these label IDs.
pageTokenNo
maxResultsNoMessages per page. Default 20.
includeSpamTrashNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.2

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds useful context about result shape (one row per message with headers, snippet, labels) and the cost trade-off of body fetching (plain_text is slower and larger), but says nothing about pagination, result caps, or ordering guarantees beyond "date-ordered."

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?

Two tight sentences with no filler, and the row-shape/scoping statement is front-loaded ahead of the sibling comparison. Every clause carries information, though the parenthetical reply/forward/label/attachments list is slightly dense.

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

Completeness4/5

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

For a read-only search tool with no output schema, the description conveys what each result row contains and the body-fetch cost, which is what an agent needs to choose a format. Pagination and default result count are left implicit, a minor gap given the annotations already establish it as a safe read.

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 67%, so most of the burden is already carried by the schema, which documents query, format, labelIds and maxResults in detail. The description adds no param-level meaning beyond hinting at ordering; pageToken and includeSpamTrash remain undocumented in both places. Baseline 3 is appropriate.

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 and resource ("Search individual messages rather than threads") and immediately clarifies granularity: "one row per message with headers, snippet and labels." This distinguishes it cleanly from the sibling search_threads, which is explicitly named.

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?

Gives an explicit selection rule: use this over search_threads when you need a specific message ID (to reply, forward, label or fetch attachments) or a date-ordered list. It names the alternative and the condition that selects it, leaving little to inference.

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