Skip to main content
Glama

Search Emails

search_emails
Read-only

Use this when the user wants to find specific emails on this Mac (Apple Mail — any account added to Mail.app). Searches subject and sender by default; pass scope="body" or scope="all" to also search the message body (see search_coverage in the response — a body search can be partial while its local index is still building). For a Microsoft 365 mailbox NOT added to Mail.app, use m365_search_emails.

IMPORTANT: on machines with 2+ accounts, call with account= (from list_email_accounts). Without it, and when the fast index can't answer, search_emails returns the account list instead of scanning all of them — scanning every account in one call has no time limit and can block Mail for other requests too. Exactly 1 account is unaffected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of matches to return.20
queryYesWhat to look for. Matched against subject and sender, or also the body when scope is "body" or "all".
scopeNo"metadata" (default, subject+sender — fast, unchanged behavior), "body" (message body only, via a local index — see search_coverage in the response), or "all" (subject+sender+body).metadata
accountNoMail.app account to search (from list_email_accounts). On a Mac with 2+ accounts this is effectively required: without it, and when the fast index cannot answer, the tool returns the account list instead of scanning them all.
mailboxNoRestrict the search to one folder, by name (see list_email_folders). Defaults to every folder of the account.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
queryNo
resultsNo
warningsNo
next_actionsNo
search_scopeNo
search_backendNo
search_coverageNo
omitted_mailboxesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / account / description
      Added value: +"Mail.app account to search (from list_email_accounts). On a Mac with 2+ accounts this is effectively required: without it, and when the fast index cannot answer, the tool returns the account list instead of scanning them all."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of matches to return."
    • addedInput schema / properties / mailbox / description
      Added value: +"Restrict the search to one folder, by name (see list_email_folders). Defaults to every folder of the account."
    • addedInput schema / properties / query / description
      Added value: +"What to look for. Matched against subject and sender, or also the body when scope is \"body\" or \"all\"."
  2. Changed4 schema fields changed
    • removedInput schema / properties / account / description
      Removed value: -"Mail.app account to search (from list_email_accounts). On a Mac with 2+ accounts this is effectively required: without it, and when the fast index cannot answer, the tool returns the account list instead of scanning them all."
    • removedInput schema / properties / limit / description
      Removed value: -"Maximum number of matches to return."
    • removedInput schema / properties / mailbox / description
      Removed value: -"Restrict the search to one folder, by name (see list_email_folders). Defaults to every folder of the account."
    • removedInput schema / properties / query / description
      Removed value: -"What to look for. Matched against subject and sender, or also the body when scope is \"body\" or \"all\"."
  3. Changed4 schema fields changed
    • addedInput schema / properties / account / description
      Added value: +"Mail.app account to search (from list_email_accounts). On a Mac with 2+ accounts this is effectively required: without it, and when the fast index cannot answer, the tool returns the account list instead of scanning them all."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of matches to return."
    • addedInput schema / properties / mailbox / description
      Added value: +"Restrict the search to one folder, by name (see list_email_folders). Defaults to every folder of the account."
    • addedInput schema / properties / query / description
      Added value: +"What to look for. Matched against subject and sender, or also the body when scope is \"body\" or \"all\"."
  4. Changed6 schema fields changed
    • addedInput schema / properties / scope
      Added value: +{
      +  "default": "metadata",
      +  "description": "\"metadata\" (default, subject+sender — fast, unchanged behavior), \"body\" (message body only, via a local index — see search_coverage in the response), or \"all\" (subject+sender+body).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / omitted_mailboxes
      Added value: +{
      +  "type": "array"
      +}
    • addedOutput schema / properties / search_backend
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / search_coverage
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / search_scope
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "type": "array"
      +}
  5. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly and non-destructive behavior, and the description adds valuable non-obvious behavior: body searches can be partial while the index builds, response includes search_coverage, and multi-account scans can be unbounded and block Mail for other requests. This goes well beyond the structured fields.

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 dense but every sentence earns its place: it front-loads the core use case, includes the critical alternative routing, and captures an important multi-account edge case with blocking and fallback behavior. No filler or redundancy.

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, the description need not explain return values, but it still pre-empts the key ambiguity (search_coverage, partial body search, account behavior). The tool is complex enough that this level of detail is needed, and nothing required to invoke it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaningful semantics beyond the schema: scope is tied to search_coverage, account becomes effectively required on 2+ account machines, and omitting account can cause an account-list fallback instead of a search. This helps the agent pick correct parameter values.

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 states a specific verb and resource: search for emails in Apple Mail on this Mac. It also differentiates from the closest sibling, m365_search_emails, and clarifies the default search scope (subject and sender) with optional body search.

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?

It explicitly says when to use the tool (find specific emails in Apple Mail) and when not to (Microsoft 365 mailbox not in Mail.app, use m365_search_emails). It also gives conditional guidance for multi-account Macs: pass account=<name> or expect the account list instead of a full scan.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources