Skip to main content
Glama
nikolausm

IMAP MCP Server

by nikolausm

imap_find_email_by_message_id

Locate an email by its RFC822 Message-ID across folders to retrieve its current folder, UID, and envelope, even if moved or archived.

Instructions

Locate an email by its RFC822 Message-ID across folders and return its current { folder, uid } plus basic envelope. Robust to the message having been moved or archived (IMAP UIDs are folder-relative). Pass the returned folder + uid to imap_reply_to_email or imap_get_email. Without folders, searches Gmail \All Mail when present, else INBOX → Archive → Sent → remaining folders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
foldersNoExplicit folders to search, in order (overrides the default order)
accountIdYesAccount ID
messageIdYesRFC822 Message-ID, with or without angle brackets
Behavior4/5

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

With no annotations, the description carries full burden. It explains IMAP UIDs are folder-relative and that the tool is robust to moves/archives, and details the default search order. It doesn't mention permissions or failure modes, but the behavior is adequately disclosed for a read operation.

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 description is two sentences that effectively front-load the purpose. It is informative without excessive verbosity, though the first sentence is somewhat long. Every sentence adds value.

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 no output schema, the description specifies return values (folder, uid, basic envelope) which is sufficient for the intended use with other tools. It doesn't detail envelope fields, but the high-level description is adequate for an agent to understand its output.

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 schema already documents each parameter. The description adds meaning by explaining that `messageId` can include or omit angle brackets and that `folders` overrides the default order. This enhances understanding beyond 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?

The description clearly states the purpose: locate an email by RFC822 Message-ID across folders and return its folder and UID. It distinguishes from siblings like imap_get_email and imap_search_emails by specifying the unique entry point via Message-ID and the returned data useful for further actions.

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 provides clear usage guidelines: it explains the default folder search order, how to override with the `folders` parameter, and how to use the output with imap_reply_to_email or imap_get_email. It doesn't explicitly compare to sibling search tools, but the context of locating by Message-ID is distinct enough.

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/nikolausm/imap-mcp-server'

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