Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

get_mailbox_status

Retrieve mailbox status including message count and unseen messages to monitor email account activity and manage inbox organization.

Instructions

Get mailbox status (message count, unseen, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxYesMailbox name

Implementation Reference

  • The core handler implementation for get_mailbox_status, which queries the IMAP client for folder status.
    def get_mailbox_status(self, mailbox: str) -> MailboxStatus:
        """Get mailbox status (message count, unseen, etc.)."""
        self._ensure_connected()
        status = self.client.folder_status(
            mailbox, ["MESSAGES", "RECENT", "UNSEEN", "UIDNEXT", "UIDVALIDITY"]
        )
        return MailboxStatus(
            name=mailbox,
            exists=status.get(b"MESSAGES", 0),
            recent=status.get(b"RECENT", 0),
            unseen=status.get(b"UNSEEN", 0),
            uidnext=status.get(b"UIDNEXT", 0),
            uidvalidity=status.get(b"UIDVALIDITY", 0),
        )
  • The tool registration/dispatch logic for get_mailbox_status within the MCP server.
    elif name == "get_mailbox_status":
        return imap_client.get_mailbox_status(args["mailbox"])

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