get_mailbox
Retrieve complete mailbox configuration details by providing an email address or local part, returning a JSON object with all relevant settings.
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
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes |
Input Schema (JSON Schema)
{
"properties": {
"target": {
"title": "Target",
"type": "string"
}
},
"required": [
"target"
],
"type": "object"
}
Implementation Reference
- migadu_mcp/tools/mailbox_tools.py:70-98 (handler)The primary handler function for the 'get_mailbox' MCP tool. It parses the target email, logs the operation, calls the mailbox service to fetch details from the API, and returns the result.@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
- Helper service method that performs the actual API call to retrieve mailbox details 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:21-25 (registration)The registration call to register_mailbox_tools(mcp), which defines and registers the get_mailbox tool via its @mcp.tool decorator.register_mailbox_tools(mcp) register_identity_tools(mcp) register_alias_tools(mcp) register_rewrite_tools(mcp) register_resources(mcp)