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 - including the same preview of the first line or two, so a search usually answers the question without a read_email after it. Not message bodies, though; 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.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already indicate read-only, idempotent, non-destructive behavior, and the description adds important details about result capping and true total counts. It does not contradict annotations and honestly states it does not return message bodies.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and contains some repetition and all-caps emphasis, but the extra length is largely justified by the need to disambiguate date matching, substring matching, and multi-folder search behavior. It could be better organized with bullets.

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?

No output schema is provided, so the description compensates by explaining the return shape: summaries like list_emails plus the folder. Combined with the schema and annotations, it gives the agent enough context to call and interpret the tool 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?

All 14 parameters are described in the schema, and the description adds important semantics: substring matching, delivered-date behavior, whole-day precision, defaults, and the one-call benefit of passing multiple mailboxes.

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?

Clearly states the tool searches one or more IMAP folders and returns email summaries in the same shape as list_emails plus the folder. It explicitly contrasts with read_email and list_emails, so the purpose is unambiguous.

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?

Provides explicit guidance on when to use search instead of read_email, how to search multiple folders in one call, and precise matching semantics for substring and date filters. It also clarifies that result caps are disclosed.

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