Skip to main content
Glama
privateemail-mcp

privateemail-mcp

search_messages

Search mailbox folders for the newest matching messages with optional sender, recipient, subject, body, date, and unread filters; returns metadata for locating emails before reading bodies.

Instructions

Search a folder and return the newest matches (uid, from, to, subject, date, read state). Use read_message with a uid for the body. All filters are optional and combine with AND.

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 contains
fromNoSender contains
textNoBody contains
limitNo
sinceNoOn or after this date, YYYY-MM-DD
beforeNoBefore this date, YYYY-MM-DD
folderNoMailbox folder path, e.g. INBOX or SentINBOX
subjectNoSubject contains
unread_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden: it discloses result ordering (newest first) and the returned field set, which is real value. However it never states that this is a read-only, non-mutating operation, nor does it explain truncation/pagination behavior when more than `limit` matches exist, or any auth/permission requirements — gaps an agent would care about on a mailbox search.

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?

Three short sentences, zero filler, and the highest-value information (what is searched, what comes back) is front-loaded before the routing hint and the filter-combination rule.

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 a 9-parameter, annotation-free, output-schema-free tool the description compensates well by enumerating returned fields and explaining filter conjunction. The remaining gap is behavioral: nothing says what happens when results are truncated or how `limit`/`folder` defaulting interacts with an empty search.

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 78%, so the baseline is 3; the description earns an extra point by stating that filters combine with AND and are all optional, which is combination semantics the schema cannot express. It also implicitly clarifies that `text` matches the body while other filters match headers, matching the return field list.

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 ("Search a folder") plus the scope of the result set ("newest matches") and the exact fields returned (uid, from, to, subject, date, read state). It also names the sibling it is not — body retrieval is delegated to read_message — so an agent can distinguish it from read_message and list_folders without opening any schema.

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?

"Use read_message with a uid for the body" gives an explicit alternative and the condition that selects it, and "All filters are optional and combine with AND" tells the agent it can call with zero arguments. There is no guidance on when to prefer list_folders for folder enumeration or how to page beyond the limit cap, so it stops short of full when/when-not coverage.

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