Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

delete_identity

DestructiveIdempotent

Delete email identities from Migadu mailboxes. Provide target, mailbox, and optional domain; this action is irreversible.

Instructions

Delete identit(ies). DESTRUCTIVE. List of dicts with: target, mailbox, domain (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • Tool handler that accepts IdentityDeleteRequest, resolves domain, formats email, logs destruction, calls the identity service's delete_identity, and returns a success envelope.
    @migadu_bulk_tool(mcp, IdentityDeleteRequest, entity="identity", destructive=True)
    async def delete_identity(
        item: IdentityDeleteRequest, ctx: Context
    ) -> dict[str, Any]:
        """Delete identit(ies). DESTRUCTIVE. List of dicts with: target, mailbox, domain (optional)."""
        domain = item.domain or resolve_domain(None)
        email = format_email_address(domain, item.target)
        await ctx.warning(f"🗑️ Deleting identity {email}")
        await (
            get_service_factory()
            .identity_service()
            .delete_identity(domain, item.mailbox, item.target)
        )
        return {"deleted": email, "success": True}
  • Pydantic schema for the delete_identity tool input: target (local part), mailbox, optional domain.
    class IdentityDeleteRequest(BaseModel):
        target: str
        mailbox: str
        domain: str | None = None
  • Registration is performed by the @migadu_bulk_tool decorator (line 89) which calls mcp.tool() as a side effect. The _ tuple keeps local references to avoid garbage collection.
    _ = (
        list_identities,
        get_identity,
        create_identity,
        update_identity,
        delete_identity,
    )
  • Service layer that sends a DELETE request to the Migadu API at /domains/{domain}/mailboxes/{mailbox}/identities/{identity}.
    async def delete_identity(self, domain: str, mailbox: str, identity: str) -> None:
        await self.client.delete(
            f"/domains/{domain}/mailboxes/{mailbox}/identities/{identity}"
        )
  • HTTP client delete method that handles Migadu's known bug where successful DELETEs return HTTP 500; treats 200, 204, 404, and 500 as success.
    async def delete(self, path: str) -> None:
        """DELETE returning None on success.
    
        Migadu has a known bug where successful DELETEs return HTTP 500.
        This method treats 200 and 500 as success. 404 is also treated as
        success (idempotent delete — already gone). Other errors raise.
        """
        client = self._get_client()
        response = await client.request("DELETE", path)
        if response.status_code in (200, 204, 404, 500):
            return None
        raise MigaduAPIError(response.status_code, response.text)
Behavior3/5

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

Annotations already provide destructiveHint, idempotentHint, and openWorldHint. The description adds 'DESTRUCTIVE' but does not elaborate on behavioral consequences (e.g., error handling, partial success). It meets minimum expectations beyond annotations.

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?

Single sentence with minimal waste; every word contributes essential information. Highly efficient for the content conveyed.

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 simple delete with one parameter and no output schema, the description is adequate but lacks details on idempotency behavior, error cases, and relationship to sibling tools. Sufficient for basic understanding but not fully comprehensive.

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?

With 0% schema description coverage, the description adds crucial meaning by detailing the structure of 'items' (list of dicts with target, mailbox, domain). However, it does not fully specify key constraints (e.g., what 'target' should be).

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 'Delete identit(ies)' and indicates the input format. However, it does not distinguish from sibling tools like delete_alias, which could overlap in context.

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 to use this tool versus alternatives (e.g., deactivate instead of delete). The 'DESTRUCTIVE' label warns of permanence but lacks context on prerequisites or fallback options.

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