Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

get_total_count

Count total emails in an IMAP mailbox to monitor message volume or track email activity. Specify a mailbox name or use the default INBOX.

Instructions

Get total email count in mailbox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxNoMailbox name (default: INBOX)

Implementation Reference

  • Actual implementation of get_total_count in the IMAP client class.
    def get_total_count(self, mailbox: str = "INBOX") -> int:
        """Get total email count in mailbox."""
        self._ensure_connected()
        status = self.client.folder_status(mailbox, ["MESSAGES"])
        return status.get(b"MESSAGES", 0)
  • MCP tool definition for get_total_count.
    make_tool(
        "get_total_count",
        "Get total email count in mailbox",
        {
            "mailbox": {"type": "string", "description": "Mailbox name (default: INBOX)"},
        },
    ),
  • MCP tool handler dispatching to the client implementation.
    elif name == "get_total_count":
        return imap_client.get_total_count(
            mailbox=args.get("mailbox", "INBOX"),
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't reveal any behavioral traits—such as whether it's a read-only operation, if it requires specific permissions, potential rate limits, or what the return format looks like. For a tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy for an agent to parse quickly without unnecessary elaboration.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a numeric count, error conditions, or format details) or any behavioral nuances. For a tool with no structured data to rely on, the description should provide more context to ensure the agent can use it correctly.

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?

The description doesn't add any parameter-specific information beyond what's in the input schema, which has 100% coverage (the 'mailbox' parameter is fully described). Since schema coverage is high, the baseline score is 3, as the description doesn't need to compensate but also doesn't enhance parameter understanding with additional context or examples.

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 verb ('Get') and resource ('total email count in mailbox'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_unread_count' or 'get_mailbox_status' which also retrieve mailbox metrics, leaving some ambiguity about when to choose this specific tool.

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 no guidance on when to use this tool versus alternatives like 'get_unread_count' or 'get_mailbox_status'. It doesn't mention prerequisites (e.g., whether authentication is required) or contextual factors that might influence tool selection, leaving the agent to infer usage from the tool name alone.

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