Skip to main content
Glama
chandshy
by chandshy

Search Emails

search_emails
Read-only

Search emails in your mailbox by sender, recipient, subject, body, date, size, status, or attachment. Supports single or multiple folders.

Instructions

Search emails by sender, recipient (To/CC/BCC), subject, body content, date range (received or sent), size, read/replied/starred/draft status, or attachment presence. Searches are server-side IMAP SEARCH except hasAttachment which filters locally. Use folder for a single folder or folders for multiple (pass ["*"] to search all). Returns summary fields. Use get_email_by_id for full content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoFilter by recipient address
bccNoFilter by BCC recipient
bodyNoSearch within email body content
fromNoFilter by sender address or name
textNoSearch headers and body (full text)
limitNoMax results (1-200, default 50)
dateToNoISO 8601 end date (INTERNALDATE — when received by server)
folderNoSingle folder to search (ignored if `folders` is set)INBOX
isReadNo
largerNoMinimum email size in bytes
foldersNoSearch multiple folders. Use ["*"] to search all folders (capped at 20). Overrides `folder`.
isDraftNoFilter by draft status
smallerNoMaximum email size in bytes
subjectNoFilter by subject text
answeredNoFilter by whether email has been replied to
dateFromNoISO 8601 start date (INTERNALDATE — when received by server)
isStarredNo
sentSinceNoFilter by Date: header since this date (ISO 8601)
account_idNoOptional account ID to route this call to (multi-account configs). Omit to use the active account. Configured account IDs are listed in the settings UI (Accounts tab).
sentBeforeNoFilter by Date: header before this date (ISO 8601)
hasAttachmentNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
emailsYes
folderYes
Behavior5/5

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

Discloses server-side IMAP SEARCH behavior and local filtering for hasAttachment, plus folder limit (capped at 20). Adds significant value beyond annotations (readOnlyHint, openWorldHint).

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?

Four concise sentences covering search criteria, behavior, return type, and alternative. Front-loaded with key information; no superfluous text.

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 21 parameters, no required params, and output schema present, description adequately covers scope, behavioral nuances, and routing (account_id). Guides agent effectively.

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?

High schema coverage (86%) gives baseline 3. Description adds grouping of filter types and special behavior for hasAttachment, enhancing understanding. Does not repeat schema details but adds context.

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 verb 'Search' and resource 'emails', lists specific filter criteria (sender, recipient, subject, etc.), and distinguishes from siblings like get_emails and get_email_by_id via folder usage and return type.

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?

Explicitly explains when to use folder vs folders (including wildcard), notes local filtering for hasAttachment, and directs to get_email_by_id for full content. Provides clear context for use.

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/chandshy/mailpouch'

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