Skip to main content
Glama
Michaelzag
by Michaelzag

list_mailboxes

Retrieve a detailed summary and statistics of email mailboxes for a specific domain. Provides JSON output with mailbox samples and insights for domain management.

Instructions

List email mailboxes for domain. Returns summary with statistics and samples.

Args: domain: Domain name. Uses MIGADU_DOMAIN if not provided.

Returns: JSON object with mailbox summary and statistics

Input Schema

NameRequiredDescriptionDefault
domainNo

Input Schema (JSON Schema)

{ "properties": { "domain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Domain" } }, "type": "object" }

Implementation Reference

  • The MCP tool handler for list_mailboxes, including decorator and implementation logic that calls the mailbox service.
    @mcp.tool( annotations={ "readOnlyHint": True, "idempotentHint": True, "openWorldHint": True, }, ) @with_context_protection(max_tokens=2000) async def list_mailboxes(ctx: Context, domain: str | None = None) -> Dict[str, Any]: """List email mailboxes for domain. Returns summary with statistics and samples. Args: domain: Domain name. Uses MIGADU_DOMAIN if not provided. Returns: JSON object with mailbox summary and statistics """ if domain is None: from migadu_mcp.config import get_config config = get_config() domain = config.get_default_domain() if not domain: raise ValueError("No domain provided and MIGADU_DOMAIN not configured") await log_operation_start(ctx, "Listing mailboxes", domain) try: service = get_service_factory().mailbox_service() result = await service.list_mailboxes(domain) count = len(result.get("mailboxes", [])) await log_operation_success(ctx, "Listed mailboxes", domain, count) return result except Exception as e: await log_operation_error(ctx, "List mailboxes", domain, str(e)) raise
  • Registration of mailbox tools (including list_mailboxes) via register_mailbox_tools call during server initialization.
    def initialize_server(): """Initialize the MCP server with all tools and resources""" # Register all tools register_mailbox_tools(mcp) register_identity_tools(mcp) register_alias_tools(mcp) register_rewrite_tools(mcp) register_resources(mcp)
  • Helper service method implementing the API call to list mailboxes for a domain.
    async def list_mailboxes(self, domain: str) -> Dict[str, Any]: """Retrieve all email mailboxes configured for a domain with complete configuration details. Returns comprehensive information for each mailbox including permissions, spam settings, autoresponder configuration, and security options for domain-wide auditing and management. """ return await self.client.request("GET", f"/domains/{domain}/mailboxes")

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/Michaelzag/migadu-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server