Skip to main content
Glama
wylieswanson

apple-mail-mcp-server

by wylieswanson

get_statistics

Read-onlyIdempotent

Aggregate inbox statistics for a mail account: message volume, read/unread/flagged counts, read ratio, and top senders over a configurable time window.

Instructions

Aggregate inbox statistics over a mailbox and time window.

A read-only analytics roll-up computed from a single search_messages pass — message volume, read/unread/flagged counts, read ratio, and the top senders (by full address or domain). This is the consolidated inbox-stats tool; per-folder unread counts live on list_mailboxes and are not duplicated here.

The window defaults to the last ~30 days (received_within_hours=720); pass date_from/date_to for an explicit range. Stats are computed over at most scan_limit of the most recent messages in the window — window_fully_covered is False when the window held more than that, so the numbers are a recent-sample rather than a silent truncation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoGroup top senders by "address" (default) or "domain".address
accountYesMail.app account name (e.g. "Gmail"). Required.
date_toNoISO date upper bound.
mailboxNoMailbox to summarize (default "INBOX").INBOX
date_fromNoISO date lower bound (composes with the window).
scan_limitNoMax messages aggregated (default 500; bounds cost).
top_senders_limitNoHow many top senders to return (default 10).
received_within_hoursNoWindow size in hours (default 720 ≈ 30 days).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety and idempotency are covered. The description adds transparency about the computational basis ('computed from a single search_messages pass'), the default window, and the truncation behavior (window_fully_covered flag). This provides valuable behavioral context beyond annotations.

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 approximately 150 words, well-structured with a clear opening sentence followed by detailed explanations. Every sentence adds value: the first states purpose, the second distinguishes from siblings, the third explains defaults and behavior. No redundant or filler content.

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 tool's complexity (8 parameters, output schema), the description is complete. It covers what is returned (volume, counts, ratio, top senders), the truncation indicator, and the relationship to search_messages. The presence of an output schema means return values need not be detailed further.

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 parameters are fully defined. The description adds context: it explains that 'by' groups top senders by 'address' or 'domain', that 'scan_limit' bounds cost, that 'received_within_hours' defaults to 720 (≈30 days), and that 'date_from'/'date_to' compose with the window. This enhances understanding beyond the schema descriptions.

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 clearly states it aggregates inbox statistics over a mailbox and time window, specifying exactly what is computed (message volume, read/unread/flagged counts, read ratio, top senders). It also distinguishes itself from the sibling tool list_mailboxes, which provides per-folder unread counts.

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?

The description provides explicit when-to-use guidance: it is 'the consolidated inbox-stats tool' and notes that per-folder unread counts 'live on list_mailboxes and are not duplicated here', directly naming an alternative. It also explains the default window and how to set explicit ranges.

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/wylieswanson/apple-mail-pz-mcp'

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