Skip to main content
Glama
paulo-amaral

applemail-mcp-server

by paulo-amaral

Search messages

apple_mail_search_messages
Read-onlyIdempotent

Search Mail.app mailboxes by sender or subject, with filters for unread, flagged, and date range, returning message metadata and handles for reading bodies.

Instructions

Search message HEADERS across one or more Mail.app mailboxes. Returns metadata plus an opaque handle per message; call apple_mail_get_message with that handle to read a body.

Cost model: every filter is pushed down into Mail.app. An unfiltered search over a large mailbox is slow, so since_days defaults to 30 and the tool refuses (rather than hangs) when more than max_scan messages match. If you get TOO_MANY_MATCHES, add filters rather than raising max_scan.

Note: query matches subject and sender only, never body text.

Returns: { total_matched, offset, count, has_more, messages: [{ handle, account, mailbox, subject, sender, date_received (ISO 8601), read, flagged }] } sorted newest first.

Examples:

  • "unread mail from UNICEF this week" -> { unread_only: true, from: "unicef", since_days: 7 }

  • "anything about the Quantum tender" -> { query: "Quantum", since_days: 180 }

  • "what did I send last month" -> { mailbox: "Sent Messages", since_days: 30 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoSubstring matched against the sender only, e.g. "unicef.org".
limitNoMessages per page (default 25).
queryNoSubstring matched against BOTH subject and sender. Body text is NOT searched (too slow over Apple Events).
offsetNoPagination offset.
accountNoExact account name as shown by apple_mail_list_accounts (e.g. "iCloud", "Work Gmail"). Omit to span every account.
mailboxNoMailbox name, e.g. "INBOX", "Sent Messages", "Archive". Defaults to the inbox of each account.
max_scanNoRefuse the query if more than this many messages match, instead of hanging. Default 400.
since_daysNoLook back this many days. Keep it small — this is the main cost control. Default 30.
unread_onlyNoOnly unread messages.
flagged_onlyNoOnly flagged messages.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
offsetYes
has_moreYes
messagesYes
total_matchedYes
Behavior5/5

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

Beyond annotations (readOnlyHint, idempotent), the description discloses the refuse-rather-than-hang behavior for max_scan, the default since_days=30, ordering (newest first), use of an opaque handle, and the never-search-body limitation. This gives the agent a rich model of runtime behavior.

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?

Well-organized with clear sections (Cost model, Note, Returns, Examples). Every sentence provides distinct value; the Returns block enumerates fields compactly and the examples are illustrative without bloat. Front-loaded with purpose and usage.

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?

For a tool with 10 params and complex cost/safety behavior, the description covers purpose, usage guidance, return format, failure mode, performance implications, and relationship to sibling tools. The embedded Returns block serves as an output schema, and the examples cover realistic scenarios.

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 already documents all 10 params (100% coverage), but the description adds substantial meaning: which params are primary cost controls (since_days, max_scan), how query vs from differ in scope, and concrete example mappings. This goes far beyond the baseline of 3 for covered schemas.

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?

Description opens with 'Search message HEADERS across one or more Mail.app mailboxes' – a specific verb, resource, and scope. It explicitly contrasts with sibling tools by stating the output is metadata plus an opaque handle, and that apple_mail_get_message is needed for bodies.

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 when-to-use guidance: cost model, filter pushdown, TOO_MANY_MATCHES recovery ('add filters rather than raising max_scan'), and examples mapping natural language requests to parameter combinations. Also states that body text is not searched, steering users to get_message.

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/paulo-amaral/applemail-mcp-server'

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