Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

set_autoresponder

Idempotent

Configure automatic email replies for Migadu mailboxes to manage responses when users are unavailable or need consistent messaging.

Instructions

Configure mailbox autoresponders. List of dicts with: target (email/local), active (required), subject (optional), body (optional), expires_on (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autorespondersYes

Implementation Reference

  • The main handler function for the 'set_autoresponder' tool, decorated with @mcp.tool for registration and execution. It handles bulk operations by delegating to the process helper.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    async def set_autoresponder(
        autoresponders: List[Dict[str, Any]], ctx: Context
    ) -> Dict[str, Any]:
        """Configure mailbox autoresponders. List of dicts with: target (email/local), active (required), subject (optional), body (optional), expires_on (optional)."""
        count = len(list(ensure_iterable(autoresponders)))
        await log_bulk_operation_start(
            ctx, "Configuring autoresponders for", count, "mailbox"
        )
    
        result = await process_set_autoresponder(autoresponders, ctx)
        await log_bulk_operation_result(
            ctx, "Autoresponder configuration", result, "mailbox"
        )
        return result
  • Pydantic schema AutoresponderRequest for input validation of autoresponder configuration parameters.
    class AutoresponderRequest(BaseModel):
        """Request schema for setting autoresponder"""
    
        target: str = Field(..., description="Email address or local part")
        active: bool = Field(..., description="Whether autoresponder is enabled")
        subject: Optional[str] = Field(None, description="Subject line for replies")
        body: Optional[str] = Field(None, description="Message content for replies")
        expires_on: Optional[date] = Field(None, description="Expiration date YYYY-MM-DD")
    
        @field_validator("expires_on")
        @classmethod
        def validate_expires_on(cls, v: Optional[date]) -> Optional[date]:
            if v and v <= date.today():
                raise ValueError("expires_on must be a future date")
            return v
  • Helper function that processes individual autoresponder requests after schema validation, parses targets, logs operations, and calls the mailbox service.
    @bulk_processor_with_schema(AutoresponderRequest)
    async def process_set_autoresponder(
        validated_item: AutoresponderRequest, ctx: Context
    ) -> Dict[str, Any]:
        """Process a single autoresponder configuration with Pydantic validation"""
        # Use validated Pydantic model directly - all validation already done
        target = validated_item.target
        active = validated_item.active
        subject = validated_item.subject
        body = validated_item.body
        expires_on = (
            validated_item.expires_on.isoformat() if validated_item.expires_on else None
        )
    
        # Parse target
        parsed = parse_email_target(target)
        domain, local_part = parsed[0]
        email_address = format_email_address(domain, local_part)
    
        status = "Enabling" if active else "Disabling"
        await log_operation_start(ctx, f"{status} autoresponder", email_address)
    
        service = get_service_factory().mailbox_service()
        result = await service.set_autoresponder(
            domain, local_part, active, subject, body, expires_on
        )
    
        await log_operation_success(
            ctx, f"{status.lower()} autoresponder", email_address
        )
        return {
            "autoresponder": result,
            "email_address": email_address,
            "success": True,
        }
  • Service method that constructs the API payload and makes the PUT request to the Migadu API to set the autoresponder configuration.
    async def set_autoresponder(
        self,
        domain: str,
        local_part: str,
        active: bool,
        subject: Optional[str] = None,
        body: Optional[str] = None,
        expires_on: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Configure mailbox autoresponder"""
        data: Dict[str, Any] = {"autorespond_active": active}
        if subject:
            data["autorespond_subject"] = subject
        if body:
            data["autorespond_body"] = body
        if expires_on:
            data["autorespond_expires_on"] = expires_on
    
        return await self.client.request(
            "PUT", f"/domains/{domain}/mailboxes/{local_part}", json=data
        )
Behavior3/5

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

Annotations cover key traits: readOnlyHint=false indicates mutation, destructiveHint=false suggests non-destructive, idempotentHint=true implies safe retries, and openWorldHint=true allows flexible inputs. The description adds value by specifying the structure of the 'autoresponders' parameter (list of dicts with fields like target, active, subject, body, expires_on), which isn't in the schema. However, it doesn't detail side effects, such as how changes affect existing autoresponders or error handling, leaving some behavioral aspects unclear.

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?

The description is a single, efficient sentence that front-loads the action ('configure mailbox autoresponders') and immediately provides parameter details. Every word serves a purpose, with no redundant or vague language, making it easy to parse quickly.

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?

Given the tool's complexity (mutation with 1 parameter, no output schema), the description is adequate but has gaps. It explains the parameter structure well, but lacks information on return values, error conditions, or how it interacts with sibling tools like update_mailbox. The annotations help, but more context on usage and outcomes would improve completeness.

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 fully compensates by detailing the 'autoresponders' parameter as a list of dicts with specific fields (target, active, subject, body, expires_on) and notes which are required or optional. This adds crucial meaning beyond the bare schema, though it doesn't explain data types or constraints for each field, preventing a perfect score.

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 verb 'configure' and resource 'mailbox autoresponders', making the purpose evident. It distinguishes from siblings like create_mailbox or update_mailbox by focusing specifically on autoresponder settings. However, it doesn't explicitly contrast with other tools that might handle mailbox configurations, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing an existing mailbox, or specify scenarios like setting up vacation responses versus general autoresponders. Without this context, users must infer usage from the tool name and description alone.

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