Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

get_alias

Read-onlyIdempotent

Retrieve detailed configuration for a specific email alias in Migadu, including forwarding rules and domain settings, to manage email routing.

Instructions

Get detailed alias information.

Args: target: Local part of alias domain: Domain name. Uses MIGADU_DOMAIN if not provided.

Returns: JSON object with complete alias configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
domainNo

Implementation Reference

  • The primary handler function for the 'get_alias' tool. It processes input parameters, resolves the domain if not provided, formats the email address, performs logging, calls the alias service to fetch the alias details, and returns the result.
    async def get_alias(
        target: str, ctx: Context, domain: str | None = None
    ) -> Dict[str, Any]:
        """Get detailed alias information.
    
        Args:
            target: Local part of alias
            domain: Domain name. Uses MIGADU_DOMAIN if not provided.
    
        Returns:
            JSON object with complete alias configuration
        """
        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")
    
        try:
            email_address = format_email_address(domain, target)
            await log_operation_start(ctx, "Retrieving alias details", email_address)
    
            service = get_service_factory().alias_service()
            result = await service.get_alias(domain, target)
            await log_operation_success(ctx, "Retrieved alias details", email_address)
            return result
        except Exception as e:
            await log_operation_error(ctx, "Get alias", f"{target}@{domain}", str(e))
            raise
  • The call to register_alias_tools(mcp) in the main initialization function, which triggers the definition and registration of the get_alias tool among others.
    register_alias_tools(mcp)
  • Helper/service layer method that performs the actual API request to retrieve the specific alias information from the Migadu API.
    async def get_alias(self, domain: str, local_part: str) -> Dict[str, Any]:
        """Get details of a specific alias"""
        return await self.client.request(
            "GET", f"/domains/{domain}/aliases/{local_part}"
        )
  • The @mcp.tool() decorator applied to the get_alias function, which registers it as an MCP tool with specific annotations.
    @mcp.tool(
        annotations={
            "readOnlyHint": True,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
Behavior4/5

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

Annotations already indicate read-only, open-world, and idempotent behavior, so the description doesn't need to repeat those. It adds value by specifying that it returns a 'JSON object with complete alias configuration', which clarifies the output format and scope beyond what annotations provide, though it could mention more about error handling or rate limits.

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 front-loaded with the core purpose, followed by structured sections for args and returns. Each sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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, annotations covering safety and behavior, and the description explaining parameters and output, it's mostly complete. However, without an output schema, the description could benefit from more detail on the JSON structure or error cases, but it adequately supports basic usage.

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?

With 0% schema description coverage, the description compensates well by explaining both parameters: 'target' as the 'Local part of alias' and 'domain' with its default behavior. This adds meaningful context beyond the bare schema, though it could elaborate on format constraints or examples for better clarity.

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 verb 'Get' and resource 'detailed alias information', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'list_aliases' (which likely lists multiple aliases) or 'get_mailbox' (which retrieves mailbox info), leaving some ambiguity about when to use this specific tool.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_aliases' or other 'get_' tools. It mentions a default for the 'domain' parameter but doesn't explain the broader context or prerequisites for invoking this tool, leaving the agent to infer usage scenarios.

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