Skip to main content
Glama

Search emails

search_emails
Read-onlyIdempotent

Search one or more IMAP folders and return summaries in exactly the shape list_emails returns plus the folder each was found in, newest first - not message bodies; read_email is the tool for reading one message in full. SEARCH EVERY FOLDER THE MESSAGE COULD BE IN, IN ONE CALL: "where is that email from Bob" usually means INBOX, Archive and Sent, and passing all three in mailboxes costs the user one call instead of three. Each result carries its own mailbox - pass that back when you act on it, because UIDs mean different messages in different folders. At least one criterion is required - an empty search is refused rather than silently returning the whole mailbox. from/to/cc/subject/body/text are SUBSTRING matches, not exact matches: searching from: "a@b.com" also matches "xa@b.commercial.example". since/before/on match the date the message was DELIVERED to this mailbox, not the sender's Date: header, and only at whole-day precision - the time of day is ignored. A result that had to be capped says so explicitly, together with the true total number of matches, so it is never mistaken for a complete list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ccNoSubstring match against the Cc address or display name.
onNoDelivered on exactly this date (e.g. "2026-08-01"). Matches when the message arrived in this mailbox, not its Date: header.
toNoSubstring match against the To address or display name.
bodyNoSubstring match against the message body.
fromNoSubstring match against the From address or display name.
seenNoFilter by read/unread status.
textNoSubstring match against headers and body together.
limitNoHow many summaries to return, newest first. Defaults to 25.
sinceNoDelivered on or after this date (e.g. "2026-08-01"). Matches when the message arrived in this mailbox, not its Date: header. Whole-day precision only.
beforeNoDelivered before this date (e.g. "2026-08-01"). Matches when the message arrived in this mailbox, not its Date: header. Whole-day precision only.
flaggedNoFilter by the flagged/starred state.
subjectNoSubstring match against the subject line.
answeredNoFilter by whether the message has been answered.
mailboxesNoIMAP folders to search, e.g. ["INBOX", "Archive", "Sent"]. Defaults to ["INBOX"]. Up to 25. Use list_mailboxes if you do not know the folder names. Naming several here is ONE call; searching them one at a time is one call each.

Schema Changelog

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

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations (readOnlyHint, openWorldHint, idempotentHint) already establish safety, so the description's job is to add behavior, and it does so extensively: substring matching semantics with a concrete false-positive example, delivery-date (not Date: header) matching with whole-day precision, explicit cap disclosure with true match totals, and the warning that UIDs are only meaningful within their folder. These are exactly the failure modes an agent would otherwise discover by making mistakes.

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?

Longer than average, but every sentence carries operational weight — there is no filler. The structure is logical: purpose and output contract first, then the cross-folder guidance, then matching gotchas, then cap behavior. The caps-lock sentence is an intentional emphasis device for the single most cost-relevant behavior. It earns its length given the density of non-obvious semantics.

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 correctly carries the return-shape burden via a reference to sibling list_emails, and covers ordering, cap disclosure, and the empty-search refusal. The boolean filters (seen/flagged/answered) are left to the schema, which describes them adequately. A minor gap is that criteria combination semantics (AND vs OR) is never stated, which an agent might guess wrong with multiple criteria.

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, and the description adds genuine collective meaning: it unifies the substring-matching rule across from/to/cc/subject/body/text and the delivery-date rule across since/before/on, which the individual schema entries don't convey as an integrated semantic. The mailboxes one-call-cost point is also reinforced in prose. The only thing not added is how multiple criteria combine (AND vs OR), but the description clearly lifts above the schema 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?

The description opens with a specific verb and resource — 'Search one or more IMAP folders and return summaries' — and precisely defines the output contract: the shape list_emails returns, plus the folder each result was found in, newest first, not message bodies. It explicitly names read_email as the alternative for full message bodies, making sibling differentiation immediate.

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?

Explicit routing guidance is present: read_email is named as the tool for reading one message in full, and list_mailboxes (in the schema) is named for unknown folder names. The SHOUTED instruction to search every candidate folder in one call, with the concrete 'where is that email from Bob' example covering INBOX/Archive/Sent, gives the agent a direct decision rule tied to user intent. It also states the empty-search refusal behavior.

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
Disambiguation4/5

Most tools target clearly distinct actions, but there are several close pairs that require careful reading: check_bounces vs check_receipts, list_emails vs search_emails, and the send/reply/forward vs draft_email/draft_reply/draft_forward families. The descriptions are strong enough that a careful agent can disambiguate, but the boundaries are not always obvious from the tool names alone.

Naming Consistency5/5

Every tool uses a consistent snake_case verb_noun convention, such as check_bounces, list_mailboxes, send_email, and update_draft. Related operations use parallel forms like mark_read/mark_unread and flag_email/unflag_email, making the naming predictable and coherent.

Tool Count2/5

With 28 tools, this exceeds the 25+ threshold where a tool set starts to feel too heavy. Email is a broad domain and many tools are individually justified, but the surface could be consolidated, especially the draft_forward/draft_reply/draft_email and send_email/reply_email/forward_email variants.

Completeness4/5

The core email lifecycle is thoroughly covered: send, read, search, move, delete, drafts, replies, forwards, folders, flags, attachments, upload links, contacts, identities, deliverability, bounces, and receipts. The main gap is that permanent deletion is referenced as a separate operation but no such tool is actually provided, and contact/identity management is effectively read-only.

Resources