Skip to main content
Glama
imap-mail-mcp

imap-mail-mcp

by EastMG

search_messages

Find emails in a mailbox by sender, subject, text, date range, or unread status. Returns UIDs and envelopes so agents can locate messages and read bodies with a separate call.

Instructions

Search messages in a mailbox. Returns uid + envelope; use read_message for the body. Chinese folder names must match list_folders output exactly.

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
fromNoSender contains
textNoFull-text search
limitNo1-100, default 20 (newest first)
sinceNoISO date, inclusive
beforeNoISO date, exclusive
unseenNoOnly unread
accountNoAccount id or email
mailboxNoFolder path, default INBOX
subjectNoSubject contains

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the burden alone. It discloses the return shape (uid + envelope, not the body) and a non-obvious matching constraint on folder names; it omits permission/auth requirements and any cost or rate considerations for broad searches.

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, each doing distinct work: purpose, return shape plus sibling routing, and a naming caveat. Nothing is repeated from the schema and nothing is padded.

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 search tool with no output schema, the description covers what comes back and how to follow up, which is the critical gap-filler. Minor omissions remain around empty-result behavior and default sorting beyond the limit parameter's "newest first" note.

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 100%, so the baseline is 3, but the description adds real meaning by warning that Chinese folder names must match list_folders output exactly — a value constraint the mailbox parameter description ("Folder path, default INBOX") does not convey.

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 messages in a mailbox") and immediately separates itself from the sibling that returns bodies by naming read_message. An agent can pick this tool over read_message without opening either 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?

Explicitly routes body retrieval to read_message, which is the main alternative an agent would weigh. It does not state when not to search (e.g. use list_folders to enumerate mailboxes first), but the context is clear enough to act on.

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