Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

disconnect

Close the IMAP connection to free resources and end email session management.

Instructions

Close IMAP connection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of the disconnect logic in the IMAP client.
    def disconnect(self) -> bool:
        """Close IMAP connection."""
        # Stop watcher if running
        if self.watcher and self.watching:
            self.watcher.stop()
            self.watching = False
    
        if self.client:
            try:
                self.client.logout()
            except Exception:
                pass
            self.client = None
            self.current_mailbox = None
        return True
  • Tool registration for 'disconnect'.
    make_tool(
        "disconnect",
        "Close IMAP connection",
        {},
    ),
  • MCP server handler for the 'disconnect' tool calling the imap_client method.
    elif name == "disconnect":
        return imap_client.disconnect()
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Close IMAP connection' indicates a destructive operation (terminates connection), but lacks details on effects (e.g., if pending operations are aborted, resource cleanup, error handling, or idempotency). It doesn't mention authentication state changes or rate limits.

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?

Extremely concise with a single sentence 'Close IMAP connection' that is front-loaded and wastes no words. Every part of the description is essential and directly contributes to understanding the tool's purpose.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. However, as a destructive operation with no annotations, it should provide more behavioral context (e.g., what happens on close, error cases) to be fully complete for safe agent use.

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?

The tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to add parameter details, so it meets the baseline of 4 for no parameters, though it could note that no inputs are required.

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 'Close IMAP connection' clearly states the action (close) and resource (IMAP connection). It distinguishes from siblings like 'connect' (open) and 'auto_connect' (automatic open), but could be more specific about what 'close' entails (e.g., termination vs. cleanup).

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?

No explicit guidance on when to use this tool versus alternatives. It implies usage after an IMAP connection is established, but doesn't specify prerequisites (e.g., must be connected first), exclusions, or timing relative to other operations like 'stop_watch'.

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