Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

list_mailboxes

Retrieve all mailbox folders from an IMAP email account to organize and manage email storage efficiently.

Instructions

List all mailbox folders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternNoFilter pattern (optional)

Implementation Reference

  • Implementation of the 'list_mailboxes' tool in the IMAP client wrapper.
    def list_mailboxes(self, pattern: str = "*") -> list[MailboxInfo]:
        """List all mailbox folders."""
        self._ensure_connected()
        folders = self.client.list_folders(pattern=pattern)
        return [
            MailboxInfo(
                name=f[2],
                delimiter=f[1],
                flags=[str(flag) for flag in f[0]],
            )
            for f in folders
        ]
  • Registration/dispatching logic for 'list_mailboxes' in the MCP server implementation.
    elif name == "list_mailboxes":
        return imap_client.list_mailboxes(pattern=args.get("pattern", "*"))

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