Skip to main content
Glama

YouSpot

Search Gmail

search_gmail_messages
Read-only

Search the user's connected Gmail mailboxes and return matching messages, newest first — from, to, subject, date, and a short snippet of the body. query uses Gmail search syntax: 'in:sent to:jane@acme.com' for messages the user sent to someone, 'from:jane@acme.com' for messages they received, plus operators like subject:, newer_than:7d, and has:attachment. So 'show me the last 5 messages I sent to jane@acme.com' is query 'in:sent to:jane@acme.com' with max_results 5. Each result carries a starred flag — a message the user starred matters to them, so weight it accordingly; 'is:starred' finds starred mail directly. For 'how many' questions, use total_matches_estimate in the result — it is Gmail's estimate of ALL matches, beyond the messages returned. If it reports no Gmail account connected, tell the user to connect one at /user/integrations. Rare header-only connections cannot run query search — the tool says so; answer correspondence questions from the brain for those.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search in Gmail query syntax, e.g. 'in:sent to:jane@acme.com newer_than:30d'.
accountNoEmail address of one connected mailbox to search. Omit to search all connected mailboxes.
max_resultsNoMax messages to return (default 10, max 100).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, which the description supports without contradiction. The description adds substantial behavioral disclosure: newest-first ordering, the exact fields returned, the meaning of the starred flag, the fact that total_matches_estimate is Gmail's broader estimate, the no-account error condition, and the rare header-only limitation. This far exceeds what 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 longer than average, but each sentence carries distinct operational value: return format, sorting, query syntax, starred-flag semantics, count estimation, and error handling. The most critical routing information (what it returns and how to query) is front-loaded, followed by edge cases. No filler or tautology is present.

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 present, the description carries the full burden of explaining the return shape and behavior, and it does so thoroughly. It covers result fields, ordering, search syntax, the count estimate, connection-failure handling, and the header-only limitation. For a search tool with Gmail's complex query language, this is complete enough for an agent to select and invoke it correctly.

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?

Although schema coverage is 100%, the description meaningfully enriches all three parameters: it explains Gmail search syntax for query with multiple examples, clarifies that omitting account searches all connected mailboxes, and ties max_results to a real example ('last 5 messages ... max_results 5'). It also adds the default/max behavior context in the schema and practical usage scenarios.

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 states a precise verb and resource: 'Search the user's connected Gmail mailboxes and return matching messages, newest first.' It enumerates the exact return fields (from, to, subject, date, snippet) and clearly distinguishes itself from sibling write tools like archive_gmail_message and create_gmail_draft by focusing on read-only search. It also differentiates from get_gmail_message by indicating this returns a list of messages with snippets rather than a single full message.

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?

The description provides concrete when-to-use guidance with examples: query syntax for sent/received mail, operators like newer_than and has:attachment, and how to phrase natural-language requests. It explicitly explains when to use total_matches_estimate for count questions and gives handling instructions for no-connected-account and header-only-connection cases, including the alternative of answering from the brain. This is rich routing context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct resource and action, with clear boundaries even within overlapping domains like LinkedIn (search vs. free-form query vs. profile vs. summary) and graph deletion (soft single, bulk soft, permanent single). Descriptions explicitly cross-reference related tools to prevent misselection.

Naming Consistency4/5

The vast majority follow a consistent verb_noun pattern (get_, list_, search_, create_, delete_, etc.). A few noun-phrase exceptions like linkedin_analytics, mutual_connections, similar_objects, and what_needs_attention deviate slightly, but they are still descriptive and do not create confusion.

Tool Count2/5

At 66 tools this is far beyond the 25+ threshold considered too many, even though the server covers many integration domains. Each domain has a coherent subset, but the overall surface is heavy for agents to navigate and would benefit from consolidation or namespacing.

Completeness4/5

The set provides deep read/search coverage across Gmail, Slack, Calendar, LinkedIn, HubSpot, Obsidian, Twitter, and a graph store, with core write operations for calendar, drafts, Slack, and graph objects. Minor gaps exist—notably no calendar delete, no direct Gmail send to third parties (only drafts), and no LinkedIn post/message actions—but these appear deliberate and do not block typical workflows.