Skip to main content
Glama
bgalmes

rubit-mcp-mail

by bgalmes

search_messages

Read-only

Search an IMAP email folder by sender, subject, body text, date range, and unread status. Combines criteria with AND, performs server-side search, and returns newest messages first.

Instructions

Search a folder. All supplied criteria are combined with AND.

Server-side IMAP search, so it works over the whole folder without downloading anything. Results are newest first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoFree text, matched against headers and body.
from_NoSubstring of the sender address or name.
limitNoMax messages to return.
sinceNoOn or after this date.
beforeNoStrictly before this date.
folderNoFolder role ('inbox', 'sent', 'junk', 'trash', 'drafts', 'archive') or a raw server folder name.inbox
offsetNoMessages to skip, for paging.
accountNoAccount name. Optional when only one is configured.
subjectNoSubstring of the subject.
unread_onlyNoOnly unread mail.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already mark it read-only and non-destructive. The description adds useful behavioral details beyond that: it is a server-side IMAP search, scans the whole folder without downloading, and returns newest-first results. This is meaningful context, though it doesn't cover edge cases like empty criteria or pagination behavior.

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, front-loaded with the purpose, then combination semantics, then operational behavior. No filler and each sentence contributes unique information.

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?

Given the output schema exists and the input schema is fully documented, the description covers the essential context: folder scope, criteria conjunction, server-side execution, and ordering. It is complete enough for confident invocation, though mentioning list_messages as a no-filter alternative would have made it slightly more complete.

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?

All 10 parameters already have schema descriptions, so the baseline is 3. The description adds the key interaction rule that all supplied criteria are combined with AND, which is not captured in the schema. It doesn't need to repeat individual parameter meanings.

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 names a specific operation ('Search a folder') and clarifies the filtering semantics ('All supplied criteria are combined with AND'). It is clear what the tool does, but it doesn't explicitly contrast it with sibling list_messages, so it falls just short of full differentiation.

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?

The description establishes a clear use case: searching a folder rather than simply listing it. It doesn't explicitly say when not to use it or name an alternative, but the server-side, criteria-based behavior gives an agent clear context for selecting it.

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