Skip to main content
Glama
yu2001-s
by yu2001-s

search-messages

Search for email messages using filters like sender, subject, date range, read status, or flagged state, and retrieve their IDs for subsequent actions.

Instructions

Use when: finding messages by query/sender/subject/date/read/flag filters and you need their ids for follow-up operations. Returns: matching messages with id, date, subject, sender, and read state (plus partial-coverage diagnostics when some mailboxes were skipped). Do not use when: you want a plain mailbox listing without filters (use list-messages), already have an id and want the body (use get-message), or want a whole conversation (use get-thread). Prefer this first to obtain the message ids that get-message/mark-as-read/delete-message/move-message and the batch tools require.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoFilter by sender (substring match against the full sender string, i.e. display name + address — not an exact address match)
limitNoMaximum number of results (default: 50, max: 500)
queryNoText to search for in subject, sender, or content
dateToNoEnd date filter (e.g., 'March 1, 2026')
isReadNoFilter by read status
accountNoAccount to search in (omit to search all accounts)
mailboxNoMailbox to search in (e.g., 'INBOX'). Omit to search all mailboxes.
subjectNoFilter by subject line (substring match)
dateFromNoStart date filter (e.g., 'January 1, 2026')
isFlaggedNoFilter by flagged status

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
partialNo
messagesNo
timedOutAccountsNo
notSearchedMailboxesNo
skippedLargeMailboxesNo
Behavior4/5

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

No annotations are present, so the description carries the full burden. It discloses the return format (id, date, subject, sender, read state) and a notable behavioral detail: partial-coverage diagnostics when some mailboxes are skipped. This is sufficient for a non-destructive search tool, though additional info on rate limits or performance could enhance it.

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?

The description is concise and front-loaded: it starts with 'Use when', then 'Returns', then 'Do not use when', and finally 'Prefer this first'. Every sentence is functional and adds value, with no wasted words.

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?

Given the output schema exists (not shown but indicated), the description appropriately covers return fields and an edge case (partial coverage). For a search tool with 10 parameters, it provides sufficient context for an agent to use it effectively.

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 100% with good descriptions for all 10 parameters. The description only mentions filters generically and does not add meaning beyond the schema. Baseline 3 is appropriate since the schema already provides full parameter documentation.

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 clearly states the tool's purpose: searching messages with various filters (query, sender, subject, date, read, flag) to obtain IDs for follow-up operations. It distinguishes from siblings like list-messages (plain listing), get-message (if ID known), and get-thread (conversation), so the agent can select correctly.

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?

The description provides explicit 'Use when' and 'Do not use when' instructions, naming specific alternatives (list-messages, get-message, get-thread). It also advises to prefer this tool first to get IDs needed by other tools, giving clear context for selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yu2001-s/apple-mail'

If you have feedback or need assistance with the MCP directory API, please join our Discord server