Skip to main content
Glama

gmail_search

Search Gmail messages using standard Gmail query syntax, returning message and thread IDs. Enable enrichment to add sender, subject, date, and snippet.

Instructions

Search Gmail messages with a Gmail query (same syntax as the Gmail search box, e.g. label:finance after:2026/01/01). Returns only id/threadId per hit by default (ids-only, cheaper). Set enrich: true to add From/Subject/Date/snippet — this costs one extra messages.get request per hit, bounded by concurrency (default 4). limit defaults to 50 when omitted; pass 0 explicitly to auto-paginate up to a hard cap (10000) — expensive combined with enrich: true, use deliberately. Read-only. Mirrors omni-dev gmail search. Output is YAML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results. Defaults to 50 when omitted; `0` explicitly means fetch every match up to the hard cap (10000).
queryYesGmail search query, same syntax as the Gmail search box (e.g. `label:finance after:2026/01/01`). Required.
enrichNoWhen `true`, enrich each hit with From/Subject/Date/snippet via one extra `messages.get` request per hit. Defaults to `false` (ids-only, the cheaper default — `messages.get` costs 20 units).
accountNoSelects a named Gmail account instead of the ambient `--account`/`OMNI_DEV_GMAIL_ACCOUNT` resolution — e.g. `work`. Omit to use the resolved default account (or the legacy single-account credentials, if no named accounts are configured). Call `gmail_account_list` to discover configured names.
concurrencyNoBounds concurrent `messages.get` calls when `enrich` is true (has no effect otherwise). Defaults to 4, clamped to 1-5 based on a 100-units/second pacing budget and 20 units per get. Bounds fan-out, not sustained request rate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.45.0
    • changedInput schema / properties / concurrency / description
      Previous value: -"Bounds concurrent `messages.get` calls when `enrich` is true (has no\neffect otherwise). Defaults to 4, clamped to 1-50 regardless of what\nis requested — Gmail's quota is 250 units/user/second and\n`messages.get` costs 5 units, so a higher value could burst past it."New value: +"Bounds concurrent `messages.get` calls when `enrich` is true (has no\neffect otherwise). Defaults to 4, clamped to 1-5 based on a\n100-units/second pacing budget and 20 units per get. Bounds fan-out,\nnot sustained request rate."
    • changedInput schema / properties / enrich / description
      Previous value: -"When `true`, enrich each hit with From/Subject/Date/snippet via one\nextra `messages.get` request per hit. Defaults to `false` (ids-only,\nthe quota-safe default — `messages.get` costs 5 units against\nGmail's 250 units/user/second budget)."New value: +"When `true`, enrich each hit with From/Subject/Date/snippet via one\nextra `messages.get` request per hit. Defaults to `false` (ids-only,\nthe cheaper default — `messages.get` costs 20 units)."
  2. Addedv0.41.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares the tool read-only, discloses the cost model (one extra messages.get = 20 units per hit), the rate-limits/pacing that clamp concurrency to 1-5, and the hard 10000 result cap. That is exactly the behavioral context an agent needs to invoke it safely and cheaply.

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?

Dense but front-loaded: the primary search semantics and default return shape come first, followed by cost/pagination caveats. Every clause carries information, though a few parameter facts are echoed 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?

There is no output schema, but the description compensates by stating the return format (YAML) and what each mode returns (id/threadId vs enriched fields). Combined with the cost and pagination disclosure, an agent has everything needed to call this correctly.

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 real meaning beyond the field docs: the interaction between limit:0 and enrich (expensive together), and why concurrency is bounded. Defaults and caps are restated but reinforced with consequences rather than bare values.

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 (Search) and resource (Gmail messages) and even specifies the query dialect (Gmail search-box syntax with an inline example). An agent can distinguish this list/find tool from gmail_message_read and gmail_thread_read without opening any 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?

Gives clear operational guidance: use default ids-only mode for cheapness, set enrich:true only when From/Subject/Date/snippet are needed, and use limit:0 deliberately since it is expensive combined with enrich. It stops short of naming an alternative sibling tool, but the when/when-not conditions are explicit.

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

Deploy Server

Other Tools