Skip to main content
Glama

search_emails

Search Apple Mail emails by query in subject or sender fields. Find specific messages using account, mailbox, and limit parameters to filter results.

Instructions

Search for emails matching a query string.

Searches in both subject and sender fields (case-insensitive).

Args: query: Search term to look for account: Account name. Uses JXA_MAIL_DEFAULT_ACCOUNT env var or first account if not specified. mailbox: Mailbox name. Uses JXA_MAIL_DEFAULT_MAILBOX env var or "Inbox" if not specified. limit: Maximum number of results (default: 50)

Returns: List of matching emails sorted by date (newest first).

Example: >>> search_emails("invoice", "Work") [{"subject": "Invoice #123", "sender": "billing@vendor.com", ...}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
accountNo
mailboxNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden and adds valuable behavioral context: it specifies case-insensitive search in subject and sender fields, default values for account/mailbox via environment variables, sorting by date (newest first), and a default limit of 50 results. This covers key operational traits beyond basic functionality.

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 well-structured and appropriately sized: a clear opening statement, followed by search scope details, parameter explanations, return info, and an example. Each sentence adds value without redundancy, and information is front-loaded with the core purpose stated first.

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?

Given no annotations and 0% schema coverage, the description provides substantial context: it explains parameters, behavior, and includes an example. However, it doesn't mention error handling, permissions, or rate limits, which could be relevant for a search tool. The output schema exists, so return values needn't be detailed, but some operational caveats are missing.

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?

Schema description coverage is 0%, so the description must compensate. It fully explains all 4 parameters: query (search term), account (with env var fallback), mailbox (with env var fallback), and limit (default 50). This adds crucial meaning beyond the bare schema, detailing defaults and environmental dependencies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for emails matching a query string, specifying the verb 'search' and resource 'emails'. It distinguishes from siblings by mentioning query-based searching, unlike tools like get_emails or get_unread_emails which likely fetch without filtering. However, it doesn't explicitly contrast with all siblings (e.g., get_flagged_emails).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for query-based email searches, with an example showing a specific use case. It doesn't explicitly state when to use this tool versus alternatives like get_emails or get_unread_emails, nor does it mention exclusions or prerequisites. The context is clear but lacks explicit guidance on tool 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/imdinu/jxa-mail-mcp'

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