Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

list_mailboxes

Read-onlyIdempotent

Retrieve email mailbox summaries with statistics for a domain in Migadu email hosting. Use to view mailbox details and samples.

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

TableJSON Schema
NameRequiredDescriptionDefault
domainNo

Implementation Reference

  • The MCP tool handler function for 'list_mailboxes', decorated with @mcp.tool(). Handles domain resolution, logging, and delegates to 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
  • The initialization function where register_mailbox_tools(mcp) is called to register the list_mailboxes tool (line 21).
    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)
  • The MailboxService method that implements the core logic by making the API request to list mailboxes for the given 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")
Behavior3/5

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

Annotations provide readOnlyHint=true, openWorldHint=true, and idempotentHint=true, covering safety and idempotency. The description adds value by specifying the return format ('JSON object with mailbox summary and statistics') and the default domain behavior, but doesn't disclose additional traits like rate limits, authentication needs, or pagination. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement, args section, and returns section, all in three concise sentences. It's front-loaded with the main action and avoids redundancy, though the 'Args:' and 'Returns:' labels are slightly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema), annotations cover safety aspects, and the description explains parameters and returns adequately. However, it lacks details on error handling, sample structure in returns, or how statistics are calculated, leaving some gaps for full agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries full burden. It explains the domain parameter's purpose ('Domain name') and default behavior ('Uses MIGADU_DOMAIN if not provided'), adding meaningful context beyond the schema's basic type and title. However, it doesn't detail format constraints (e.g., valid domain patterns) or other nuances.

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 tool's purpose: 'List email mailboxes for domain' specifies the verb (list) and resource (email mailboxes), and distinguishes it from siblings like get_mailbox (which likely retrieves a single mailbox) and create_mailbox (which creates one). However, it doesn't explicitly differentiate from list_aliases or list_identities, which are similar listing operations for different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the domain parameter context ('Uses MIGADU_DOMAIN if not provided'), suggesting it's for listing mailboxes within a domain. However, it lacks explicit guidance on when to use this versus alternatives like get_mailbox (for single mailbox details) or other list_* tools, and doesn't mention prerequisites or exclusions.

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

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