Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

update_identity

Idempotent

Modify email identity configurations for Migadu mailboxes, including sender permissions, display names, and domain associations.

Instructions

Update identity settings. List of dicts with: target, mailbox (required), domain, name, may_send, may_receive (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYes

Implementation Reference

  • The main MCP tool handler for 'update_identity', decorated with @mcp.tool. It handles bulk updates by logging, calling the process_update_identity helper, and returning results.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    async def update_identity(
        updates: List[Dict[str, Any]], ctx: Context
    ) -> Dict[str, Any]:
        """Update identity settings. List of dicts with: target, mailbox (required), domain, name, may_send, may_receive (optional)."""
        count = len(list(ensure_iterable(updates)))
        await log_bulk_operation_start(ctx, "Updating", count, "identity")
    
        result = await process_update_identity(updates, ctx)
        await log_bulk_operation_result(ctx, "Identity update", result, "identity")
        return result
  • Pydantic BaseModel schema 'IdentityUpdateRequest' used for input validation in the update_identity tool pipeline.
    class IdentityUpdateRequest(BaseModel):
        """Request schema for updating an identity"""
    
        target: str = Field(..., description="Local part of identity address")
        mailbox: str = Field(..., description="Username of mailbox that owns this identity")
        domain: Optional[str] = Field(None, description="Domain name")
        name: Optional[str] = Field(None, description="Update display name")
        may_send: Optional[bool] = Field(
            None, description="Allow/deny sending from identity"
        )
        may_receive: Optional[bool] = Field(
            None, description="Allow/deny receiving to identity"
        )
        may_access_imap: Optional[bool] = Field(None, description="Allow/deny IMAP access")
        may_access_pop3: Optional[bool] = Field(None, description="Allow/deny POP3 access")
        may_access_managesieve: Optional[bool] = Field(
            None, description="Allow/deny ManageSieve access"
        )
        footer_active: Optional[bool] = Field(None, description="Enable/disable footer")
        footer_plain_body: Optional[str] = Field(
            None, description="Plain text footer content"
        )
        footer_html_body: Optional[str] = Field(None, description="HTML footer content")
  • The call to register_identity_tools(mcp) in the main server initialization, which defines and registers the update_identity tool among others.
    register_identity_tools(mcp)
  • Helper function 'process_update_identity' that handles single update: resolves domain, formats email, calls IdentityService.update_identity, and logs the operation.
    @bulk_processor_with_schema(IdentityUpdateRequest)
    async def process_update_identity(
        validated_item: IdentityUpdateRequest, ctx: Context
    ) -> Dict[str, Any]:
        """Process a single identity update"""
        # 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, "Updating identity", email_address)
    
        service = get_service_factory().identity_service()
        result = await service.update_identity(
            domain,
            validated_item.mailbox,
            validated_item.target,
            validated_item.name,
            validated_item.may_send,
            validated_item.may_receive,
        )
    
        await log_operation_success(ctx, "Updated identity", email_address)
        return {"identity": result, "email_address": email_address, "success": True}
  • IdentityService.update_identity method that constructs the API payload and makes the PUT request to the Migadu API to perform the actual identity update.
    async def update_identity(
        self,
        domain: str,
        mailbox: str,
        identity: str,
        name: Optional[str] = None,
        may_send: Optional[bool] = None,
        may_receive: Optional[bool] = None,
    ) -> Dict[str, Any]:
        """Update identity settings"""
        data: Dict[str, Any] = {}
        if name is not None:
            data["name"] = name
        if may_send is not None:
            data["may_send"] = may_send
        if may_receive is not None:
            data["may_receive"] = may_receive
    
        return await self.client.request(
            "PUT",
            f"/domains/{domain}/mailboxes/{mailbox}/identities/{identity}",
            json=data,
        )
Behavior4/5

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

Annotations provide readOnlyHint=false, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description doesn't contradict these annotations and adds useful context about the required vs optional fields in the updates. However, it doesn't mention important behavioral aspects like authentication requirements, rate limits, or what happens when updates fail.

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

Conciseness3/5

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

The description is brief (two sentences) but could be more front-loaded. The first sentence is clear, but the second sentence contains important parameter information that might be better integrated. While not verbose, it lacks the polished structure of the best descriptions.

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?

For a mutation tool with no output schema and rich annotations, the description provides basic parameter semantics but lacks important context. It doesn't explain what constitutes an 'identity' versus other resources, what the update operation returns, or potential side effects. The annotations help but don't fully compensate for these gaps.

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 carries the full burden of parameter documentation. It successfully explains that the 'updates' parameter should be a list of dicts with specific fields (target, mailbox, domain, name, may_send, may_receive) and indicates which are required vs optional. This adds significant value beyond the completely undocumented schema.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool updates identity settings, which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like update_mailbox or update_alias, leaving ambiguity about what specifically distinguishes identity updates from other update operations.

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 is provided about when to use this tool versus alternatives like create_identity or delete_identity. The description doesn't mention prerequisites, use cases, or contextual factors that would help an agent choose this tool appropriately among the many sibling tools available.

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