Skip to main content
Glama
mail-mcp-server

mail-mcp-server

summarizeSenders

summarizeSenders
Read-onlyIdempotent

Count locally synced emails by sender address or domain to see message volume per sender and where messages are filed, with optional folder, date, query, and sender filters.

Instructions

Count locally synced messages by sender address or domain in one connection, with each sender's dates and folders, to see who sends how much and where it is filed. Without filters it covers the whole local mailbox; optionally restrict by folder and dates, or by query and field with the same syntax as search, for example to preview what a mail rule would match; from adds one sender address to a query. The totals state what the counts cover, including messages without a date or a parsable sender.

Counts do not show mailbox rules or when messages were moved: old messages left in a folder do not prove that a rule fails, so compare each folder's dates. A sender does not define a message's purpose; list or search that sender's cards with search before recommending anything.

messages counts recognized copies once; folders counts every stored copy, so its sum can exceed messages.

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": {
      "connection": "<connection>"
    },
    "name": "summarizeSenders"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoOnly messages from this one complete sender address, ignoring case. Combines with query and field
fieldNoField group for query, as in search; default any. Without query, field has no effect
limitNoSenders per page: 1 to 200, default 50; larger values are capped at 200
queryNoSearch terms, a quoted phrase or a full email address, as in search; at most 1000 characters. Omit to count all messages
sinceNoInclude messages at or after this date/time, using the message Date header, in the same format as search. Messages without a date are excluded
untilNoInclude messages strictly before this date/time; same header and format as since. Messages without a date are excluded
folderNoOne folder key from listFolders, not its display name. Omit to count all folders in the connection
offsetNoDefault 0. For the next page, repeat the same arguments and use the previous nextOffset. Stop when there is no nextOffset
groupByNoaddress (default) or domain
connectionYesConnection name from listConnections

Output Schema

NameRequiredDescriptionDefault
fromNoApplied sender address filter.
fieldYesField searched.
queryNoText query; absent when not given.
sinceNoApplied since bound, in UTC.
totalYesSender rows across all pages.
untilNoApplied until bound, in UTC.
folderNoFolder key counted; absent for all folders.
latestNoLatest date among matching messages; absent when none has a date.
offsetYesPosition of this page.
groupByYesaddress or domain.
sendersYesSenders, most messages first.
undatedYesMatching messages without a date.
earliestNoEarliest date among matching messages; absent when none has a date.
messagesYesAll matching messages; copies of one message count once.
connectionYesConnection name.
nextOffsetNoPass as offset to get the next page; absent at the end.
withoutSenderYesMatching messages without a parsable sender, such as failed messages; they are in no row.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.6/5.0
Behavior4/5

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

The annotations already declare readOnly, idempotent, non-destructive, so the safety profile is covered. The description still adds substantive semantics: messages counts recognized copies once while folders counts every stored copy (so its sum can exceed messages), the totals state what they cover including messages with no date or unparsable sender, and it warns that counts cannot prove rule failure or message-move timing. That is genuine behavioral context beyond the annotations, though the return-shape discussion is partially redundant with the output 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?

Front-loaded with the core action and scope, then filters, then caveats — a logical order with no filler sentences. It is on the long side for three paragraphs, and the mail-rule caveat, while useful, is the least essential passage.

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 10-parameter aggregation tool with an output schema present, the description covers the scope of the counts, the two count semantics that could mislead an agent, and the boundary against sibling search. Nothing needed to call or interpret it correctly appears to be 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 description coverage is 100%, so the baseline is 3; the description earns above that by explaining composition rules the schema only implies — `from` adds one sender address to a query and combines with query/field, and the filter modes are presented as a coherent choice set. It does not add syntax examples for the date formats, but that gap is minor given how thoroughly the schema documents each parameter.

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?

"Count locally synced messages by sender address or domain in one connection, with each sender's dates and folders" names a specific verb (count), a specific grouping dimension (sender address or domain), and the scope (one connection, local mailbox). This clearly separates it from sibling tools like search and listMessages, which retrieve messages rather than aggregate counts per sender.

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 states the default behavior (no filters = whole local mailbox), the optional restriction paths (folder/dates, or query+field with search syntax), a concrete motivating use case ("preview what a mail rule would match"), and how `from` composes with query. It also explicitly routes the agent elsewhere when counts are insufficient: "list or search that sender's cards with search before recommending anything."

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