get_mailbox
Retrieve detailed mailbox configuration information from Migadu email hosting services using email addresses or local parts with smart domain resolution.
Instructions
Get detailed mailbox information with smart domain resolution.
Args: target: Email address or local part if MIGADU_DOMAIN set
Returns: JSON object with complete mailbox configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes |
Implementation Reference
- migadu_mcp/tools/mailbox_tools.py:70-98 (handler)The primary handler for the 'get_mailbox' tool. Decorated with @mcp.tool() and implements the core logic: parses the target email address, calls the mailbox service to fetch details, handles logging and errors.@mcp.tool( annotations={ "readOnlyHint": True, "idempotentHint": True, "openWorldHint": True, }, ) async def get_mailbox(target: str, ctx: Context) -> Dict[str, Any]: """Get detailed mailbox information with smart domain resolution. Args: target: Email address or local part if MIGADU_DOMAIN set Returns: JSON object with complete mailbox configuration """ try: parsed = parse_email_target(target) domain, local_part = parsed[0] email_address = format_email_address(domain, local_part) await log_operation_start(ctx, "Retrieving mailbox details", email_address) service = get_service_factory().mailbox_service() result = await service.get_mailbox(domain, local_part) await log_operation_success(ctx, "Retrieved mailbox details", email_address) return result except Exception as e: await log_operation_error(ctx, "Get mailbox", str(target), str(e)) raise
- Service layer helper method that performs the actual API call to retrieve mailbox information from Migadu.async def get_mailbox(self, domain: str, local_part: str) -> Dict[str, Any]: """Retrieve detailed configuration for a specific mailbox including all settings and permissions. Shows complete mailbox state including authentication, protocol access, spam filtering, autoresponder status, and security policies for inspection and troubleshooting. """ return await self.client.request( "GET", f"/domains/{domain}/mailboxes/{local_part}" )
- migadu_mcp/main.py:18-25 (registration)Top-level registration where register_mailbox_tools(mcp) is called, which in turn registers the get_mailbox tool via its @mcp.tool decorator.def initialize_server(): """Initialize the MCP server with all tools and resources""" # Register all tools register_mailbox_tools(mcp) register_identity_tools(mcp) register_alias_tools(mcp) register_rewrite_tools(mcp) register_resources(mcp)