Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

create_identity

Create email identities by specifying target, mailbox, name, password, and optionally domain. Provides a structured list of identities for bulk operations.

Instructions

Create identit(ies). List of dicts with: target, mailbox, name, password, domain (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • The MCP tool handler for 'create_identity'. Registered via @migadu_bulk_tool decorator, it validates input against IdentityCreateRequest, resolves the domain, formats the email address, delegates to the IdentityService, and returns the result with success flag.
    @migadu_bulk_tool(mcp, IdentityCreateRequest, entity="identity", idempotent=False)
    async def create_identity(
        item: IdentityCreateRequest, ctx: Context
    ) -> dict[str, Any]:
        """Create identit(ies). List of dicts with: target, mailbox, name, password, domain (optional)."""
        domain = item.domain or resolve_domain(None)
        email = format_email_address(domain, item.target)
        await ctx.info(f"📋 Creating identity {email} on {item.mailbox}")
        result = (
            await get_service_factory()
            .identity_service()
            .create_identity(
                domain, item.mailbox, item.target, item.name, item.password
            )
        )
        return {"identity": result, "email_address": email, "success": True}
  • Pydantic model defining the input schema for creating an identity. Fields: target (local part), mailbox, name, password, and optional domain.
    class IdentityCreateRequest(BaseModel):
        target: str = Field(..., description="Local part of identity address")
        mailbox: str = Field(..., description="Username of mailbox that owns this identity")
        name: str
        password: str
        domain: str | None = None
  • The create_identity tool is registered via register_identity_tools(), which is called from initialize_server() in main.py. It uses @migadu_bulk_tool decorator which internally calls mcp.tool() with annotations including readOnlyHint=False and idempotentHint=False.
    def register_identity_tools(mcp: FastMCP) -> None:
        @migadu_tool(mcp, read_only=True, summarize_response=True)
        async def list_identities(
            mailbox: str, ctx: Context, domain: str | None = None
        ) -> dict[str, Any]:
            """List identities (send-as addresses) for a mailbox."""
            resolved = resolve_domain(domain)
            await ctx.info(f"📋 Listing identities for {mailbox}@{resolved}")
            return (
                await get_service_factory()
                .identity_service()
                .list_identities(resolved, mailbox)
            )
    
        @migadu_tool(mcp, read_only=True)
        async def get_identity(
            mailbox: str, identity: str, ctx: Context, domain: str | None = None
        ) -> dict[str, Any]:
            """Get full details for a specific identity."""
            resolved = resolve_domain(domain)
            await ctx.info(f"📋 Getting identity {identity}@{resolved} for {mailbox}")
            return (
                await get_service_factory()
                .identity_service()
                .get_identity(resolved, mailbox, identity)
            )
    
        @migadu_bulk_tool(mcp, IdentityCreateRequest, entity="identity", idempotent=False)
        async def create_identity(
            item: IdentityCreateRequest, ctx: Context
        ) -> dict[str, Any]:
            """Create identit(ies). List of dicts with: target, mailbox, name, password, domain (optional)."""
            domain = item.domain or resolve_domain(None)
            email = format_email_address(domain, item.target)
            await ctx.info(f"📋 Creating identity {email} on {item.mailbox}")
            result = (
                await get_service_factory()
                .identity_service()
                .create_identity(
                    domain, item.mailbox, item.target, item.name, item.password
                )
            )
  • The IdentityService.create_identity method that makes the actual HTTP POST request to the Migadu API endpoint /domains/{domain}/mailboxes/{mailbox}/identities with local_part, name, and password as JSON body.
    async def create_identity(
        self,
        domain: str,
        mailbox: str,
        local_part: str,
        name: str,
        password: str,
    ) -> dict[str, Any]:
        data = {"local_part": local_part, "name": name, "password": password}
        return await self.client.post(
            f"/domains/{domain}/mailboxes/{mailbox}/identities", json=data
        )
Behavior2/5

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

Annotations indicate readOnlyHint=false (consistent) and openWorldHint=true, but the description lacks details on idempotency, error handling, or side effects. It doesn't address what happens if an identity already 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?

Very concise single sentence that front-loads the action and required parameters. No redundant text, though it could be slightly more structured.

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

Completeness2/5

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

No output schema and minimal description. For a creation tool with array input, more details on return value, atomicity, and validation rules are needed. Siblings exist but are not referenced.

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

Parameters3/5

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

The input schema only has 'items' with no item structure. The description adds meaning by listing fields (target, mailbox, name, password, domain), compensating for 0% schema coverage. However, it doesn't specify field types or constraints.

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 'Create identit(ies)' with input fields (target, mailbox, name, password, domain). It distinguishes from sibling tools like create_mailbox or create_domain, though 'identity' could be more explicitly defined.

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?

No guidance on when or when not to use this tool. No mention of alternatives or prerequisites. For instance, it doesn't clarify if domain is required or if items are processed individually.

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