Skip to main content
Glama

Search emails

search_emails
Read-onlyIdempotent

Search emails across all connected Gmail accounts using Gmail query syntax, returning a merged, date-sorted list even if some accounts fail.

Instructions

Search with Gmail query syntax (e.g. "from:ana@x.com is:unread newer_than:7d"). Omit "account" to search EVERY configured mailbox in parallel and get one merged, date-sorted list. If one account fails the others still return, and the failure is reported in "failures".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesGmail search query, exactly as typed in the Gmail search box.
accountNoRestrict to one account. Omit to search all of them.
max_resultsNoMaximum messages to return (per account when searching all). Default 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior. The description adds meaningful behavioral context beyond that: parallel search across accounts, a merged and date-sorted result, partial failure tolerance, and an explicit 'failures' field. This substantially helps an agent anticipate what happens at runtime.

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?

Three sentences with no filler. The query syntax example is front-loaded, followed by the key scoping behavior and then failure semantics. Every sentence contributes essential information.

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 simple 3-parameter search tool, the description plus annotation set covers defining query syntax, account scoping, result ordering, and partial failure behavior. It does not detail the shape of the returned message objects, but the absence of an output schema is partially mitigated by the clear description of the merged date-sorted list and failures field.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds value by showing a concrete Gmail query example and emphasizing that omitting 'account' triggers a parallel search across all mailboxes. The max_results parameter is left to the schema, which documents it clearly.

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 specific verb ('search') and resource ('emails') and adds the essential Gmail query syntax. It clearly distinguishes this from sibling retrieval tools like read_message by framing it as query-based search, and the cross-mailbox behavior further pins down what the tool does.

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?

The description gives clear operational guidance: omit 'account' to search all mailboxes, or include it to restrict the search. It describes a concrete invocation strategy and failure behavior. It does not explicitly name alternatives or exclusion criteria, but none of the sibling tools perform the same email search role.

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