Skip to main content
Glama
macos-mail-mcp

macos-mail-mcp

search_messages

Searches Apple Mail messages by subject, sender, or content, defaulting to a single mailbox and requiring explicit permission for broad or large-mailbox queries.

Instructions

Search one mailbox safely by default. Broad, content or large-mailbox searches require explicit allowSlow. Returns an object with messages and partial/timeout/skipped/error metadata within a 45 second server budget. Mail's queued Apple events can outlive process cancellation; wait or restart Mail after a timeout.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "field": "<field>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNoInclude messages received on/after this ISO date
fieldYesField to search; content requires allowSlow and a single account/mailbox
limitNoMaximum unique results, 1–200 (default 50)
queryNoSearch text; may be empty when after or before is supplied
beforeNoInclude messages received on/before this ISO date
allowSlowNoExplicitly permit broad searches, content searches or mailboxes over 1,000 messages; queued Mail work may outlive cancellation
accountNameNoMail account; default searches require both account and mailbox
mailboxNameNoMailbox name or full path; requires accountName

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv3.0.0
    • changedInput schema / properties / accountName / description
      Previous value: -"Limit search to a specific account (omit to search all accounts)"New value: +"Mail account; default searches require both account and mailbox"
    • changedInput schema / properties / after / description
      Previous value: -"Only return messages received after this ISO 8601 date (e.g. 2024-01-15T00:00:00Z)"New value: +"Include messages received on/after this ISO date"
    • addedInput schema / properties / allowSlow
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly permit broad searches, content searches or mailboxes over 1,000 messages; queued Mail work may outlive cancellation",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / before / description
      Previous value: -"Only return messages received before this ISO 8601 date (e.g. 2024-12-31T23:59:59Z)"New value: +"Include messages received on/before this ISO date"
    • changedInput schema / properties / field / description
      Previous value: -"The field to search in"New value: +"Field to search; content requires allowSlow and a single account/mailbox"
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results to return (default 50)"New value: +"Maximum unique results, 1–200 (default 50)"
    • removedInput schema / properties / limit / exclusiveMinimum
      Removed value: -0
    • changedInput schema / properties / limit / maximum
      Previous value: -9007199254740991New value: +200
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / mailboxName / description
      Previous value: -"Limit search to a specific mailbox (omit to search all mailboxes)"New value: +"Mailbox name or full path; requires accountName"
    • changedInput schema / properties / query / description
      Previous value: -"The search query string (optional when using date filters)"New value: +"Search text; may be empty when after or before is supplied"
  2. Changed2 schema fields changedv1.3.2
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / limit / maximum
      Added value: +9007199254740991
  3. First observedv1.2.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full load and does so well: it discloses a 45-second server budget, partial/timeout/skipped/error metadata in the response, and the non-obvious side effect that queued Apple events can outlive process cancellation, including remediation ('wait or restart Mail'). These are exactly the behaviors an agent could not infer from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences lead with the default-safe scope before the cost/constraint, which is the right front-loading. Some phrasing is compressed to the point of being cryptic ('Broad, content or large-mailbox searches'), but nothing is padding.

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?

For an eight-parameter, no-output-schema tool, the description covers the return envelope shape, the timeout budget, and the cancellation caveat, so an agent has enough to call it and interpret failure. It stops short of defining what counts as 'broad' (left to the schema's 1,000-message note) or describing result ordering.

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%, so all eight parameters are already documented, including the field enum and the allowSlow constraint. The description restates only the content-search constraint already present in the field and allowSlow schema entries, adding no new semantics; baseline 3 applies.

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 states a specific verb and resource ('Search one mailbox') and immediately scopes it to single-mailbox, default-safe operation, which separates it from a broad content sweep. It never names list_messages or get_message explicitly, so sibling differentiation is implied rather than stated.

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?

It gives a clear rule for when the slow path applies: broad, content, or large-mailbox searches 'require explicit allowSlow'. That is genuine when/when-not guidance, though no alternative tool is named for the cases where this one is the wrong choice.

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