Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

list_aliases

Read-onlyIdempotent

Retrieve email alias information for a domain, including summary statistics and sample data, to manage email forwarding configurations.

Instructions

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

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

Returns: JSON object with alias summary and statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNo

Implementation Reference

  • The primary handler for the 'list_aliases' MCP tool. Includes decorators for registration and protection, input handling, logging, service delegation, and result processing.
    @mcp.tool(
        annotations={
            "readOnlyHint": True,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    @with_context_protection(max_tokens=2000)
    async def list_aliases(ctx: Context, domain: str | None = None) -> Dict[str, Any]:
        """List email aliases for domain. Returns summary with statistics and samples.
    
        Args:
            domain: Domain name. Uses MIGADU_DOMAIN if not provided.
    
        Returns:
            JSON object with alias 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 aliases", domain)
        try:
            service = get_service_factory().alias_service()
            result = await service.list_aliases(domain)
            count = len(result.get("aliases", []))
            await log_operation_success(ctx, "Listed aliases", domain, count)
            return result
        except Exception as e:
            await log_operation_error(ctx, "List aliases", domain, str(e))
            raise
  • The call to register_alias_tools which defines and registers the list_aliases tool (and other alias tools) with the FastMCP instance.
    register_alias_tools(mcp)
  • Supporting service method that performs the actual API request to retrieve aliases from Migadu.
    async def list_aliases(self, domain: str) -> Dict[str, Any]:
        """List all aliases for a domain"""
        return await self.client.request("GET", f"/domains/{domain}/aliases")
  • The registration function that contains the tool definitions and @mcp.tool decorators for alias tools including list_aliases.
    def register_alias_tools(mcp: FastMCP):
        """Register alias tools using List[Dict] + iterator pattern"""
    
        @mcp.tool(
            annotations={
                "readOnlyHint": True,
                "idempotentHint": True,
                "openWorldHint": True,
            },
        )
        @with_context_protection(max_tokens=2000)
        async def list_aliases(ctx: Context, domain: str | None = None) -> Dict[str, Any]:
            """List email aliases for domain. Returns summary with statistics and samples.
    
            Args:
                domain: Domain name. Uses MIGADU_DOMAIN if not provided.
    
            Returns:
                JSON object with alias 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 aliases", domain)
            try:
                service = get_service_factory().alias_service()
                result = await service.list_aliases(domain)
                count = len(result.get("aliases", []))
                await log_operation_success(ctx, "Listed aliases", domain, count)
                return result
            except Exception as e:
                await log_operation_error(ctx, "List aliases", domain, str(e))
                raise
Behavior4/5

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

Annotations provide readOnlyHint, openWorldHint, and idempotentHint, indicating safe, non-destructive, and repeatable behavior. The description adds value by specifying the return format ('JSON object with alias summary and statistics') and the default domain behavior, which are not covered by annotations. It does not contradict annotations, as listing aligns with read-only operations.

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 appropriately sized and front-loaded, with the first sentence stating the core purpose and return value. The 'Args' and 'Returns' sections are structured efficiently, providing necessary details without redundancy. Every sentence adds value, making it concise and well-organized.

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

Completeness4/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) and rich annotations, the description is mostly complete. It covers purpose, parameter semantics, and return format adequately. However, it could improve by mentioning pagination or error handling, though annotations help mitigate gaps. The lack of output schema is compensated by describing the return value.

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?

The input schema has 1 parameter with 0% description coverage, so the description carries the burden. It explains the 'domain' parameter's purpose ('Domain name') and default behavior ('Uses MIGADU_DOMAIN if not provided'), adding meaningful semantics beyond the schema. However, it lacks details like format constraints or examples, preventing a perfect score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with specific verb ('List') and resource ('email aliases for domain'), and distinguishes it from siblings by focusing on listing rather than creating, deleting, or updating aliases. It also specifies what is returned ('summary with statistics and samples'), making the purpose explicit and differentiated.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to list email aliases for a domain) and includes a default behavior (using MIGADU_DOMAIN if domain not provided), which guides usage. However, it does not explicitly state when not to use it or name alternatives (e.g., get_alias for a single alias), though the sibling list tools (list_identities, list_mailboxes, list_rewrites) imply a pattern for listing operations.

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