Skip to main content
Glama
cybersmurf
by cybersmurf

Search messages

mail_search_emails
Read-onlyIdempotent

Search emails by text, sender, recipient, subject, folder, date, unread, or attachments, or list a thread. Returns message IDs, thread, sender, date, and preview, newest first with paging.

Instructions

Searches mail (full text, sender, recipient, subject, folder, date, unread, attachments) or lists a whole thread. Returns message ids (for mail_get_email), thread, sender, date and a preview. Newest first, paging through limit/offset. Without a filter it returns the latest messages from all folders (trash included) — for “what is new” use mailbox="inbox", unread=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoRecipient (part of the name or address).
fromNoSender (part of the name or address).
textNoFull text across subject, body and headers.
afterNoOnly messages received from this date on (YYYY-MM-DD or ISO 8601).
limitNoHow many messages to return (1–100).
beforeNoOnly messages received up to this date (YYYY-MM-DD or ISO 8601).
offsetNoHow many messages to skip (paging).
unreadNotrue = unread only.
accountNoWhich account: leave empty for the signed-in mailbox, or name a shared mailbox / group you have access to (the part before @ is enough; a full address works too). mail_list_mailboxes shows what exists.
mailboxNoFolder: inbox, sent, drafts, trash, junk, archive, or a folder name.
subjectNoPart of the subject.
thread_idNoList every message of this thread (threadId from an earlier result); other filters are then ignored.
has_attachmentNotrue = only messages with an attachment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.3.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already establish readOnly/idempotent/non-destructive/openWorld, so the description's job is to add beyond that — and it does: default scope includes trash, results are newest-first, paging is via limit/offset, and the returned fields (ids, thread, sender, date, preview) are named. It doesn't discuss rate limits or result caps beyond the schema's limit=100.

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 front-loaded sentences with no filler: capability, return shape plus ordering/paging, then the default-scope caveat and its remedy. Every sentence earns its place.

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?

With no output schema, the description must carry return-value information, and it does (ids for mail_get_email, thread, sender, date, preview, newest-first ordering). For a 13-parameter, all-optional search tool, an agent has everything needed to form a correct first call.

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 schema carries the per-parameter meaning. The description adds cross-parameter guidance not present in the schema: the no-filter default, the inbox+unread combination for new mail, and thread_id suppressing other filters.

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 (searches mail) and enumerates the searchable facets plus the thread-listing mode, which is a distinct capability. It references sibling mail_get_email as the natural follow-up, so an agent can place it in the workflow without opening another 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 a concrete conditional: with no filter it returns the latest messages from all folders including trash, and it directs 'what is new' queries to mailbox="inbox", unread=true. It also notes thread_id overrides other filters. It stops short of naming a competing tool to prefer for other cases, but the context provided is operationally clear.

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