Skip to main content
Glama
smankoo

owlpost

search_messages

Read-onlyIdempotent

Search one email folder with filters such as sender, subject, date, read status, or attachments, returning message envelopes newest first without marking mail as read.

Instructions

Search one folder with structured filters and return message envelopes, newest first.

All filters are combined with AND. String filters use IMAP case-insensitive substring matching; multi-word values are quoted for you. Each result has uid, folder, message_id, subject, from/to/cc, date, flags, size, seen and flagged; pass folder + uid to read_email for the body. The folder is opened read-only, so searching never marks mail read.

Args: account: Account name from list_accounts. folder: Folder to search (default "INBOX"); use list_folders or resolve_folder for others. from_: Substring of the From header (name or address). to: Substring of the To header. cc: Substring of the Cc header. subject: Substring of the Subject. body: Substring of the message body. text: Substring of headers or body. since: Only messages on or after this date (YYYY-MM-DD). before: Only messages before this date (YYYY-MM-DD). unseen: Only unread messages. seen: Only read messages. flagged: Only flagged/starred messages. has_attachment: Best-effort filter for messages with attachments (multipart/mixed or an attachment disposition header). raw: A raw IMAP SEARCH string, e.g. 'OR FROM "alice" FROM "bob"'. When set, every other filter is ignored. limit: Maximum number of results (default 50).

Input Schema

NameRequiredDescriptionDefault
ccNo
toNo
rawNo
bodyNo
seenNo
textNo
from_No
limitNo
sinceNo
beforeNo
folderNoINBOX
unseenNo
accountYes
flaggedNo
subjectNo
has_attachmentNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes beyond the readOnlyHint annotation with IMAP-specific behavior: the folder is opened read-only so searching never marks mail read, filters combine with AND, matching is case-insensitive substring with automatic quoting of multi-word values, and results are newest-first with a default limit of 50. The only gap is that it says nothing about pagination or how to page past the limit.

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 first sentence front-loads purpose, scope, and ordering before any detail, and the per-parameter list is dense and free of filler. Given 16 undocumented parameters, the length is justified rather than padded.

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?

With an output schema present the return-value enumeration (uid, folder, message_id, subject, from/to/cc, date, flags, size, seen, flagged) is technically redundant, but it usefully tells the agent which fields are available for follow-up calls. Combined with the filter semantics and the read_email handoff, nothing needed to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does: all 16 parameters are documented inline with meaning, defaults (INBOX, 50), date format (YYYY-MM-DD), and the non-obvious precedence rule that raw IMAP SEARCH overrides every other filter. This is exactly the compensation the low coverage requires.

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 one folder'), the filter model ('structured filters'), and the return shape ('message envelopes, newest first'). The 'one folder' scope plus the pointer to read_email for bodies lets an agent separate it from the sibling tools without opening a 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?

Gives concrete routing advice: use list_folders or resolve_folder to get non-default folders, and pass folder+uid to read_email for the body. It also flags the raw-parameter override rule. It does not, however, say when to prefer this over get_conversation or a plain folder listing.

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