Skip to main content
Glama
iCloud Mail MCP server

iCloud Mail MCP server

by lachsmith

Search messages

search_messages
Read-only

Search an iCloud mailbox by sender, recipient, subject, text, date, unread or flagged status, and return matching message headers with short snippets for quick review.

Instructions

Searches one mailbox, newest first. All filters are optional and combine with AND; with none, returns the most recent messages. Returns headers and a short snippet per message. Use get_message for the full body.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
toNoRecipient name or address contains this text.
fromNoSender name or address contains this text.
textNoHeaders or body contain this text.
limitNo
sinceNoOnly messages on or after this date (YYYY-MM-DD).
beforeNoOnly messages before this date (YYYY-MM-DD).
offsetNoSkip this many results, for paging.
unreadNotrue for unread only, false for read only.
flaggedNotrue for flagged only, false for unflagged only.
mailboxNoFolder path from list_mailboxes. Defaults to "INBOX".INBOX
subjectNoSubject contains this text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true) and open-world scope, but the description adds genuinely useful behavior: result ordering (newest first), default listing when unfiltered, and the shape of what comes back (headers plus a short snippet). It stops short of mentioning permissions or paging limits beyond the schema's own offset parameter.

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 short sentences, front-loaded with the core verb and scope, then defaults, then return shape, then the handoff to get_message. No redundant restatement of schema fields.

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 11-parameter, all-optional search tool with no output schema, the description covers purpose, filter logic, default behavior, and return granularity well enough to call it correctly. Minor gaps remain around result volume/paging behavior, but nothing essential 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 91%, so the baseline is 3, and the description earns an extra point by adding cross-parameter semantics the schema cannot express: filters are optional and AND-combined, and omitting all of them yields the most recent messages. It doesn't restate per-parameter syntax, which the schema already handles well.

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?

States a specific verb and resource ('Searches one mailbox') plus scope ('one mailbox, newest first'), and explicitly redirects to the sibling get_message for full bodies. An agent can distinguish this from get_message, get_thread and list_mailboxes without opening a schema.

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?

Explains the filter-combination rule ('All filters are optional and combine with AND'), the no-filter default ('returns the most recent messages'), and names the alternative tool with the condition that selects it ('Use get_message for the full body'). Little is left to inference.

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