Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

create_identity

Create email identities for Migadu email hosting by specifying mailbox, name, password, and optional domain details to establish new email accounts.

Instructions

Create email identities. List of dicts with: target, mailbox, name, password (required), domain (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identitiesYes

Implementation Reference

  • The primary handler function for the 'create_identity' MCP tool. It handles bulk creation requests by delegating to the process_create_identity helper after logging.
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": True,
        },
    )
    async def create_identity(
        identities: List[Dict[str, Any]], ctx: Context
    ) -> Dict[str, Any]:
        """Create email identities. List of dicts with: target, mailbox, name, password (required), domain (optional)."""
        count = len(list(ensure_iterable(identities)))
        await log_bulk_operation_start(ctx, "Creating", count, "identity")
    
        result = await process_create_identity(identities, ctx)
        await log_bulk_operation_result(ctx, "Identity creation", result, "identity")
        return result
  • Pydantic schema IdentityCreateRequest used by bulk_processor_with_schema for validating each identity creation input item.
    class IdentityCreateRequest(BaseModel):
        """Request schema for creating an identity"""
    
        target: str = Field(..., description="Local part of identity address")
        mailbox: str = Field(..., description="Username of mailbox that owns this identity")
        name: str = Field(..., description="Display name for identity")
        password: str = Field(..., description="Password for SMTP authentication")
        domain: Optional[str] = Field(None, description="Domain name")
  • Helper function process_create_identity that validates a single item using the schema, determines domain, formats email, calls the identity service, and logs the operation.
    @bulk_processor_with_schema(IdentityCreateRequest)
    async def process_create_identity(
        validated_item: IdentityCreateRequest, ctx: Context
    ) -> Dict[str, Any]:
        """Process a single identity creation"""
        # Get domain if not provided
        domain = validated_item.domain
        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")
    
        email_address = format_email_address(domain, validated_item.target)
        await log_operation_start(
            ctx, "Creating identity", f"{email_address} for {validated_item.mailbox}"
        )
    
        service = get_service_factory().identity_service()
        result = await service.create_identity(
            domain,
            validated_item.mailbox,
            validated_item.target,
            validated_item.name,
            validated_item.password,
        )
    
        await log_operation_success(ctx, "Created identity", email_address)
        return {"identity": result, "email_address": email_address, "success": True}
  • The IdentityService.create_identity method that makes the actual API POST request to Migadu to create the identity.
    async def create_identity(
        self, domain: str, mailbox: str, local_part: str, name: str, password: str
    ) -> Dict[str, Any]:
        """Create a new identity for a mailbox"""
        data = {"local_part": local_part, "name": name, "password": password}
        return await self.client.request(
            "POST", f"/domains/{domain}/mailboxes/{mailbox}/identities", json=data
        )
  • In main.py, register_identity_tools(mcp) is called, which defines and registers the create_identity tool via its @mcp.tool decorator.
    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)
Behavior3/5

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

Annotations indicate this is a non-read-only, non-destructive, non-idempotent, open-world operation, which the description doesn't contradict. The description adds some context by specifying required and optional fields, but it lacks details on behavioral traits like error handling, permissions needed, or rate limits. With annotations covering basic safety, the description provides minimal additional behavioral insight.

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 brief and to the point, using a single sentence that efficiently conveys key information. It front-loads the purpose and immediately lists parameters, with no wasted words. However, it could be slightly more structured for clarity, such as separating purpose from parameter details.

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 complexity (creation operation with multiple fields), lack of output schema, and annotations that only cover basic hints, the description is somewhat incomplete. It provides parameter semantics but misses usage guidelines, behavioral details like error cases, and output expectations. It's adequate as a minimum but has clear gaps for effective agent use.

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 0% description coverage and only defines 'identities' as an array of objects. The description compensates by specifying that 'identities' should be a 'List of dicts with: target, mailbox, name, password (required), domain (optional)', adding meaningful semantics beyond the schema. However, it doesn't fully detail all properties or their formats, leaving some gaps.

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 action ('Create email identities') and specifies the resource ('email identities'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'create_mailbox' or 'create_alias', which might also involve email-related creation, leaving some ambiguity about when to choose this specific tool over others.

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 'create_mailbox' or 'create_alias', nor does it mention any prerequisites or exclusions. It only lists required and optional fields, which is more about parameter details than usage context.

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