Skip to main content
Glama

search_emails

Read-onlyIdempotent

Search connected mailboxes. Results are compact summaries; use get_email to read a message. To search one folder, supply its mailbox accountId with folderId. Returns indexed results immediately while mailbox searches continue in the background. pendingAccountIds identifies mailboxes still searching; semanticPending:true means semantic results are not ready yet, even when messages is empty and nextCursor is absent. If semanticPending is true, retry the identical query and filters once after about 500 ms, preserving accountId, folderId, and limit, omitting cursor, and setting waitForFresh:false. Check semanticPending on the follow-up; if it remains true, treat results as incomplete rather than as no matches. This is independent of provider freshness and pendingAccountIds. failures identifies settled errors. Repeat the same query and filters without a cursor, with waitForFresh:false, to obtain accumulated results. nextCursor paginates existing results. Stale or pending results are not proof that a mailbox is empty. Set waitForFresh to wait briefly for a provider update.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
sortNoText searches default to relevance. Inbox and folder lists default to newest first. Choose relevance, newest first, or oldest first explicitly.
afterNo
limitNo
queryNo
beforeNo
cursorNo
isReadNo
subjectNo
folderIdNoOpaque folder ID from list_mail_folders. Requires the same accountId because folders belong to one mailbox.
accountIdNo
isStarredNo
maxWaitMsNoMaximum refresh wait in milliseconds (up to 15000). At the deadline, a cached copy may be returned with freshness metadata; this is not a guarantee of a fresh response.
waitForFreshNoWait briefly for a provider refresh instead of immediately returning a cached copy. Check the returned freshness timestamps and stale/refreshing flags.
hasAttachmentsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safety profile (read-only, idempotent, openWorld); the description adds substantial behavioral context beyond them: background mailbox searching, semanticPending vs. pendingAccountIds independence, provider freshness, failures as settled errors, and the heuristic that stale/pending results do not prove a mailbox empty. This is exactly the kind of disclosure annotations cannot carry.

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?

Purpose and the get_email pointer are front-loaded, and most of the length is earned by genuinely complex asynchronous semantics. However, the semanticPending retry instructions are dense and the retry rule is restated ('repeat the same query and filters') without a cursor, plus the closing 'not proof that a mailbox is empty' caveat, adding mild redundancy.

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?

With no output schema, the description usefully names the return signals the caller must inspect (pendingAccountIds, semanticPending, failures, nextCursor, messages) and explains how to interpret them. It is close to complete for a complex tool, with residual gaps only on the undocumented filter parameters.

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 coverage is only 25% across 16 params, so the description must compensate. It adds real meaning for cursor (paginates existing results), waitForFresh, maxWaitMs behavior via freshness, and the accountId+folderId pairing, but leaves to/from/subject/query/after/before/isRead/isStarred/hasAttachments unaddressed. Partial compensation for a low-coverage schema lands at the baseline.

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 connected mailboxes') and immediately delineates the sibling relationship by directing the agent to get_email for reading a message and clarifying results are compact summaries. An agent can distinguish it from get_email and get_thread 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit conditional guidance: accountId+folderId to search one folder, get_email to read, waitForFresh to await a provider update, and a precise retry protocol for semanticPending. The when-to-use, how-to-follow-up, and alternative tool are all spelled out rather than inferred.

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.

Resources