Skip to main content
Glama
ni-c

imap-mcp

by ni-c

List and search messages

list_messages
Read-only

Search and page through IMAP mailbox messages newest first, with optional filters for sender, recipient, subject, body, date range, flags, or keyword. Server-side filtering keeps large folders fast.

Instructions

Lists messages newest first, optionally narrowed by sender, recipient, subject, body text, date range or flags. With no criteria it simply pages through the mailbox. Every filter is applied by the mail server, so searching a large folder is cheap. Returns summaries only — use get_message for the body.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoSubstring to match in the To header.
bodyNoSubstring to match in the message body.
fromNoSubstring to match in the From header.
seenNotrue for read messages only, false for unread only.
limitNoMaximum number of messages to return (default from IMAP_MAX_MESSAGES, hard cap 200).
sinceNoOnly messages received on or after this date (YYYY-MM-DD).
beforeNoOnly messages received before this date (YYYY-MM-DD).
offsetNoHow many messages to skip, newest first, for paging.
flaggedNotrue for flagged/starred messages only.
keywordNoOnly messages carrying this custom IMAP keyword.
mailboxNoMailbox (folder) name exactly as returned by list_mailboxes, e.g. "INBOX" or "INBOX/Archive". Defaults to the configured mailbox.
subjectNoSubstring to match in the subject.
Behavior4/5

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

Annotations only declare readOnlyHint, so the description must supply behavioral depth. It adds sorting (newest first), output scope (summaries only), and a performance trait (server-side filter execution). This goes well beyond the annotation without contradicting it.

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?

Four short sentences, no filler, with the core behavior and ordering in the opening line. Every sentence carries a distinct fact: filtering options, no-criteria behavior, server-side performance, and summary-only return. This is appropriately compact for a 12-parameter tool.

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 tool with no required parameters and a fully described schema, the description covers the behavior that matters: ordering, summary output, body alternative, and paging behavior. It doesn't describe exact summary fields or explicitly distinguish all sibling tools, but the schema and the get_message pointer fill most of the gap. Given no output schema, the 'summaries only' statement is sufficient directional guidance.

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 already documents all 12 parameters, so the baseline is 3. The description adds a useful grouping of filter types and clarifies that omitting criteria turns the call into a page-through of the mailbox. It also ties filtering to server-side execution, which is operational context the schema does not provide.

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 ('Lists messages newest first') and enumerates the viable filters, including sender, recipient, subject, body, date range, and flags. It also points to get_message for full body, which helps disambiguate from sibling list/get tools. However, it never explicitly contrasts this with list_new_messages, so sibling differentiation is incomplete.

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?

It states when to page without criteria and why: 'With no criteria it simply pages through the mailbox' and 'searching a large folder is cheap' due to server-side filtering. It explicitly routes body retrieval to get_message: 'Returns summaries only — use get_message for the body.' It doesn't mention when to prefer list_new_messages over this tool, so exclusions are partial.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ni-c/imap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server