Skip to main content
Glama
mail-mcp

mail-mcp

by spencer-fs

search_messages

Read-onlyIdempotent

Search mailbox messages by folder, date, sender, subject, body, or read/flagged status, returning identifiers and metadata for follow-up mail actions.

Instructions

Search messages, newest first. Returns one line per message with the folder, uidvalidity and uid that every other tool needs, plus date, sender, recipients, subject, flags, size and attachment count. All criteria 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
bodyNoText to find in the message body.
limitNoHow many results to return (default 25, at most 100).
sinceNoOnly messages received on or after this date (YYYY-MM-DD).
beforeNoOnly messages received before this date (YYYY-MM-DD).
folderNoFolder to search, or "all" for every folder.INBOX
offsetNoSkip this many results, for paging.
senderNoText to find in the From header.
unreadNotrue = unread only, false = read only.
flaggedNotrue = flagged only, false = unflagged only.
subjectNoText to find in the subject.
recipientNoText to find in the To or Cc headers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds behavior the annotations cannot: result ordering (newest first), the one-line-per-message projection, and the exact field set returned, which is what an agent needs to chain into read_message or set_flags.

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?

Two sentences, front-loaded with the action, and every clause carries information an agent needs. The second sentence is dense with a long enumerated field list, but nothing is filler or redundant.

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?

There is no output schema, and the description compensates by describing the return shape and ordering, which is the main gap it needed to fill. With all 11 params documented in the schema and only 2 sentences of description, an agent has enough to call it correctly; the only soft spot is that total-result counts and paging behavior are not mentioned.

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 would be 3, but the description contributes genuine semantics beyond the schema by specifying that all criteria are optional and are ANDed together. It still says nothing about how text criteria are matched (substring vs token) or how folder='all' interacts with paging.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Search messages, newest first') and then enumerates the returned fields, so an agent knows this is the discovery/listing tool that produces the folder/uidvalidity/uid identifiers used by other tools. It stops short of explicitly naming a sibling to contrast against, so differentiation is implied rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states the important combining rule ('All criteria are optional and combine with AND'), which tells an agent how to build a query. However, it gives no explicit when-to-use or when-not guidance, no routing to read_message/get_thread for full content retrieval, and no note on how to page beyond the schema's limit/offset.

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