Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

delete_mailbox

DestructiveIdempotent

Delete one or more mailboxes from your Migadu hosting account by specifying each mailbox's target identifier.

Instructions

Delete mailbox(es). DESTRUCTIVE. List of dicts with: target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • Tool handler function for delete_mailbox - parses target, calls service layer, returns deletion result.
    @migadu_bulk_tool(mcp, MailboxDeleteRequest, entity="mailbox", destructive=True)
    async def delete_mailbox(
        item: MailboxDeleteRequest, ctx: Context
    ) -> dict[str, Any]:
        """Delete mailbox(es). DESTRUCTIVE. List of dicts with: target."""
        domain, local_part = parse_email_target(item.target)[0]
        email = format_email_address(domain, local_part)
        await ctx.warning(f"🗑️ Deleting mailbox {email}")
        await get_service_factory().mailbox_service().delete_mailbox(domain, local_part)
        return {"deleted": email, "success": True}
  • Pydantic schema for MailboxDeleteRequest with a single 'target' field.
    class MailboxDeleteRequest(BaseModel):
        target: str = Field(..., description="Email address or local part")
  • Service layer method that sends DELETE request to the Migadu API for the specified mailbox.
    async def delete_mailbox(self, domain: str, local_part: str) -> None:
        await self.client.delete(f"/domains/{domain}/mailboxes/{local_part}")
  • HTTP DELETE method on the MigaduClient that handles Migadu's known bug (500 on successful delete) and treats 404 as idempotent 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)
  • Registration function called from main.py to register all mailbox tools (including delete_mailbox) with the FastMCP server.
    def register_mailbox_tools(mcp: FastMCP) -> None:
Behavior3/5

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

Annotations already provide destructiveHint true and idempotentHint true. Description adds 'DESTRUCTIVE' but no additional context about consequences, permissions, or side effects beyond the 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?

Three concise segments with front-loaded action and warning. No redundant information. Every word earns its place.

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?

For a simple one-parameter tool with annotations, the description is nearly complete. It misses only the precise definition of 'target' and error conditions. Output schema is absent, but description doesn't need to cover that.

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?

Schema has 0% coverage for items parameter. Description adds 'List of dicts with: target', hinting at the structure, but does not fully specify what 'target' means (e.g., email address or ID). Provides some value beyond empty schema.

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

Purpose5/5

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

Clearly states the action 'Delete mailbox(es)' and the resource, with a warning label 'DESTRUCTIVE'. Distinguishes from sibling tools like create_mailbox or update_mailbox.

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., delete_alias, delete_forwarding). No prerequisites or conditions mentioned.

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