Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

mark_unread

Mark specific emails as unread to highlight them for later review or follow-up in your IMAP email account.

Instructions

Mark emails as unread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidsYesEmail UIDs
mailboxNoMailbox name (default: current)

Implementation Reference

  • The actual implementation of the mark_unread logic, which removes the \Seen flag from the given UIDs.
    def mark_unread(self, uids: list[int], mailbox: Optional[str] = None) -> bool:
        """Mark emails as unread."""
        self._ensure_connected()
        if mailbox:
            self.select_mailbox(mailbox)
        self.client.remove_flags(uids, [b"\\Seen"])
        return True
  • Tool definition/registration for "mark_unread" in the MCP server.
    make_tool(
        "mark_unread",
        "Mark emails as unread",
        {
            "uids": {
                "type": "array",
                "items": {"type": "number"},
                "description": "Email UIDs",
            },
            "mailbox": {"type": "string", "description": "Mailbox name (default: current)"},
        },
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. While 'mark emails as unread' implies a state mutation, it doesn't specify whether this requires authentication, what permissions are needed, whether the operation is reversible, or what happens on success/failure. No rate limits, side effects, or error conditions are mentioned.

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 waste. It's front-loaded with the core purpose and contains no unnecessary words or redundant information.

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?

For a state mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, what happens on success/failure, or any behavioral constraints. Given the complexity of email state management and the lack of structured metadata, more context is needed about how this operation interacts with the email system.

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 (uids and mailbox). The description doesn't add any parameter-specific information beyond what's in the schema, such as explaining what UIDs represent or how the mailbox parameter affects the operation. 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 verb ('mark') and resource ('emails') with the specific state change ('as unread'). It distinguishes from the sibling 'mark_read' by specifying the opposite state, but doesn't explicitly differentiate from other email state manipulation tools like 'flag_email' or 'archive_email'.

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 guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (like needing to fetch emails first), when this operation is appropriate, or what happens if emails are already unread. It also doesn't reference the sibling 'mark_read' for the opposite operation.

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