Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

idle_watch

Monitor a single IMAP mailbox for new email arrivals in real-time using the IDLE protocol, with configurable timeout settings.

Instructions

Start watching mailbox for new emails (IMAP IDLE) - single mailbox, temporary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxNoMailbox to watch (default: INBOX)
timeoutNoWatch timeout in seconds (default: 300)

Implementation Reference

  • The core implementation of the idle_watch tool, which uses IMAP IDLE to monitor a mailbox for a specified timeout.
    def idle_watch(
        self, mailbox: str = "INBOX", timeout: int = 300
    ) -> dict:
        """Start watching mailbox for new emails (IMAP IDLE) - single mailbox, temporary."""
        self._ensure_connected()
        self.select_mailbox(mailbox)
    
        self.client.idle()
        responses = self.client.idle_check(timeout=timeout)
        self.client.idle_done()
    
        return {
            "mailbox": mailbox,
            "responses": [str(r) for r in responses],
        }
    
    # === Auto-Archive ===
  • Tool registration definition for idle_watch, including its schema (input parameters).
    make_tool(
        "idle_watch",
        "Start watching mailbox for new emails (IMAP IDLE) - single mailbox, temporary",
        {
            "mailbox": {"type": "string", "description": "Mailbox to watch (default: INBOX)"},
            "timeout": {"type": "number", "description": "Watch timeout in seconds (default: 300)"},
        },
    ),
  • The server-side dispatch logic that routes the MCP tool call to the imap_client.idle_watch method.
    elif name == "idle_watch":
        return imap_client.idle_watch(
            mailbox=args.get("mailbox", "INBOX"),
            timeout=args.get("timeout", 300),
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool is 'temporary' (implying it may stop after timeout or session end) and uses IMAP IDLE (a push protocol), which adds some context. However, it doesn't describe what happens during/after watching (e.g., how new emails are reported, if it blocks other operations, error handling, or resource implications), leaving significant gaps for a tool that likely involves ongoing monitoring.

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 concise and front-loaded with the core purpose in a single sentence. The parenthetical '(IMAP IDLE)' and suffix '- single mailbox, temporary' add useful context efficiently. There's no wasted text, though it could be slightly more structured (e.g., separating scope notes).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (ongoing monitoring with IMAP IDLE), no annotations, no output schema, and 2 parameters, the description is incomplete. It lacks details on behavior during/after execution, error conditions, interaction with other tools (e.g., 'stop_watch'), and what the agent should expect as a result. This is inadequate for a tool that likely involves stateful operations.

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 description coverage is 100%, so the schema already documents both parameters (mailbox and timeout) with descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema, such as explaining valid mailbox formats or timeout behavior specifics. Baseline 3 is appropriate when schema does the heavy lifting.

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 clearly states the tool's purpose: 'Start watching mailbox for new emails (IMAP IDLE) - single mailbox, temporary'. It specifies the action (start watching), resource (mailbox/emails via IMAP IDLE), and scope (single, temporary). However, it doesn't explicitly distinguish from sibling tools like 'start_watch' or 'stop_watch', which appear to be related.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal usage guidance. It mentions 'single mailbox, temporary' which gives some context about scope and duration, but offers no explicit guidance on when to use this tool versus alternatives like 'start_watch' or 'stop_watch', nor does it mention prerequisites (e.g., connection/authentication state).

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/Soundhannes/IMAP-MCP'

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