Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

create_forwarding

Create email forwardings that require external recipient confirmation. Specify mailbox, address, optional domain, expiry date, and auto-removal settings.

Instructions

Create forwarding(s). Forwardings require external-user confirmation. List of dicts with: mailbox, address, domain (optional), expires_on (optional, YYYY-MM-DD), remove_upon_expiry (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • The MCP tool handler for 'create_forwarding' — decorated with @migadu_bulk_tool, receives a ForwardingCreateRequest, delegates to forwarding_service.create_forwarding(), and returns the result.
    @migadu_bulk_tool(
        mcp, ForwardingCreateRequest, entity="forwarding", idempotent=False
    )
    async def create_forwarding(
        item: ForwardingCreateRequest, ctx: Context
    ) -> dict[str, Any]:
        """Create forwarding(s). Forwardings require external-user confirmation. List of dicts with: mailbox, address, domain (optional), expires_on (optional, YYYY-MM-DD), remove_upon_expiry (optional)."""
        domain = item.domain or resolve_domain(None)
        await ctx.info(
            f"📋 Creating forwarding {item.address} on {item.mailbox}@{domain}"
        )
        result = (
            await get_service_factory()
            .forwarding_service()
            .create_forwarding(
                domain=domain,
                mailbox=item.mailbox,
                address=str(item.address),
                expires_on=item.expires_on.isoformat() if item.expires_on else None,
                remove_upon_expiry=item.remove_upon_expiry,
            )
        )
        return {"forwarding": result, "success": True}
  • The Pydantic schema ForwardingCreateRequest used for input validation of the create_forwarding tool. Includes fields: mailbox, address (EmailStr), domain, expires_on (future date validated), remove_upon_expiry.
    class ForwardingCreateRequest(BaseModel):
        mailbox: str = Field(
            ..., description="Mailbox local part the forwarding belongs to"
        )
        address: EmailStr = Field(..., description="External email address to forward to")
        domain: str | None = None
        expires_on: date | None = None
        remove_upon_expiry: bool | None = None
    
        @field_validator("expires_on")
        @classmethod
        def _future_expiry(cls, v: date | None) -> date | None:
            if v is not None and v <= date.today():
                raise ValueError("expires_on must be a future date")
            return v
  • Registration call: register_forwarding_tools(mcp) invoked during server initialization, which sets up all forwarding tools including create_forwarding.
    register_forwarding_tools(mcp)
  • The underlying service method ForwardingService.create_forwarding() that makes the actual HTTP POST to Migadu API endpoint /domains/{domain}/mailboxes/{mailbox}/forwardings with address, expires_on, and remove_upon_expiry.
    async def create_forwarding(
        self,
        domain: str,
        mailbox: str,
        address: str,
        expires_on: str | None = None,
        remove_upon_expiry: bool | None = None,
    ) -> dict[str, Any]:
        data: dict[str, Any] = {"address": address}
        if expires_on is not None:
            data["expires_on"] = expires_on
        if remove_upon_expiry is not None:
            data["remove_upon_expiry"] = remove_upon_expiry
        return await self.client.post(
            f"/domains/{domain}/mailboxes/{mailbox}/forwardings", json=data
        )
Behavior3/5

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

Annotations indicate the tool is not read-only and not destructive, which is consistent with creation. The description adds a behavioral note that forwardings require external-user confirmation, which is valuable 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.

Conciseness4/5

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

The description is concise with three distinct pieces of information: action, behavioral note, and parameter structure. The first sentence is somewhat redundant with the tool name, but overall no unnecessary content.

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?

The description does not mention return values or response format, which is a gap given there is no output schema. It also lacks details on validation or required fields beyond what's implied.

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, so the description compensates by explaining the structure of the 'items' array, listing fields with optionality and date format. This provides essential meaning missing from the schema.

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 forwarding(s)' with a list of required fields, making the purpose clear. However, it does not differentiate from sibling tools like create_alias or create_rewrite.

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 explicit guidance on when to use this tool versus alternatives. The description does not mention scenarios where forwarding is appropriate compared to aliases or rewrites.

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