Skip to main content
Glama
mailbox-org-mcp
by getrdone

Search messages

mailbox_search_messages
Read-only

Search mailbox messages with Gmail-style filters and list newest matches first, including folder and UID for follow-up mailbox actions.

Instructions

Search mail with Gmail-style syntax and list matches newest first (subject, sender, date, folder, UID, read/star/color/labels, attachments, newsletter). Use the folder + UID with the other mailbox_ tools. Gmail-style query. Examples: from:amazon is:unread | subject:"invoice" newer_than:30d | has:attachment larger:5M | label:$purchases | color:red | is:starred -from:me | has:unsubscribe older_than:6m | (from:a OR from:b) | in:Archive. Bare words search headers and body. Empty = all messages.

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": "mailbox_search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
queryNoGmail-style query. Examples: from:amazon is:unread | subject:"invoice" newer_than:30d | has:attachment larger:5M | label:$purchases | color:red | is:starred -from:me | has:unsubscribe older_than:6m | (from:a OR from:b) | in:Archive. Bare words search headers and body. Empty = all messages.
offsetNo
foldersNoFolders to search. Default INBOX. ["all"] searches every folder except Trash and Junk.
response_formatNo'markdown' for readable text (default), 'json' for complete structured datamarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so safety is covered and the description instead adds real behavioral context: matches come back newest first, the per-message field set is enumerated, and the caller learns the folder + UID are reusable keys for downstream mailbox_ operations. It says nothing about result caps, rate limiting, or how the default folder set interacts with the search, which keeps it off a 5.

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?

The core capability and result ordering are front-loaded in the first clause, followed by the downstream-use hint and the example block. The pipe-delimited example run is dense and purposeful, though it duplicates the query parameter's schema description rather than summarizing it, which costs a bit of redundancy.

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?

With five optional parameters and no output schema, the description carries the return-value burden and does so by enumerating the per-match fields, which is the right compensation. It is complete enough to call correctly; the remaining gaps are pagination semantics and any note on how limit/offset interact with the newest-first ordering.

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

Parameters3/5

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

Schema coverage is 60%, so roughly half the parameter meaning is already documented. The description's query examples are near-verbatim repeats of the query property description, and the folder default (INBOX, or ["all"] to widen scope) lives in the schema, so the description mostly restates rather than extends. limit and offset are never discussed in the description, leaving pagination behavior to the schema.

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?

"Search mail with Gmail-style syntax and list matches newest first" gives a specific verb, resource, and result ordering, then enumerates the fields returned per match. It also tells the agent that the resulting folder + UID pairs feed the other mailbox_ tools, which distinguishes it from point-lookup siblings like mailbox_get_message or aggregate siblings like mailbox_count_messages.

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 definition makes the usage context explicit through eight concrete query examples covering sender, subject, age, attachment, label, color, star, and folder scoping, plus "Empty = all messages" for the no-filter case. It never names an exclusion or an alternative tool (e.g. when to prefer mailbox_count_messages for a tally, or mailbox_get_message for a single known UID), so it stops short of full routing guidance.

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