Skip to main content
Glama
Michaelzag
by Michaelzag

reset_mailbox_password

Reset mailbox passwords for Migadu email accounts by specifying the target email and providing a new password. Handle password updates efficiently with this tool.

Instructions

Reset mailbox passwords. List of dicts with: target (email/local), new_password (required).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resetsYes

Implementation Reference

  • MCP tool handler function implementing bulk mailbox password resets using the bulk processor helper.
    @mcp.tool( annotations={ "readOnlyHint": False, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True, }, ) async def reset_mailbox_password( resets: List[Dict[str, Any]], ctx: Context ) -> Dict[str, Any]: """Reset mailbox passwords. List of dicts with: target (email/local), new_password (required).""" count = len(list(ensure_iterable(resets))) await log_bulk_operation_start(ctx, "Resetting passwords for", count, "mailbox") result = await process_reset_password(resets, ctx) await log_bulk_operation_result(ctx, "Password reset", result, "mailbox") return result
  • Pydantic input schema model for validating password reset requests used by the bulk processor.
    class MailboxPasswordResetRequest(BaseModel): """Request schema for resetting mailbox password""" target: str = Field(..., description="Email address or local part") new_password: str = Field(..., description="New password for authentication")
  • Bulk processing helper that validates individual reset requests and invokes the mailbox service API call.
    @bulk_processor_with_schema(MailboxPasswordResetRequest) async def process_reset_password( validated_item: MailboxPasswordResetRequest, ctx: Context ) -> Dict[str, Any]: """Process a single password reset with Pydantic validation""" # Use validated Pydantic model directly - all validation already done target = validated_item.target new_password = validated_item.new_password # Parse target parsed = parse_email_target(target) domain, local_part = parsed[0] email_address = format_email_address(domain, local_part) await log_operation_start(ctx, "Resetting password", email_address) service = get_service_factory().mailbox_service() await service.reset_mailbox_password(domain, local_part, new_password) await log_operation_success(ctx, "Reset password", email_address) return {"reset": email_address, "success": True}
  • Service method performing the actual Migadu API PUT request to update the mailbox password.
    async def reset_mailbox_password( self, domain: str, local_part: str, new_password: str ) -> Dict[str, Any]: """Reset mailbox password""" data = {"password": new_password} return await self.client.request( "PUT", f"/domains/{domain}/mailboxes/{local_part}", json=data )
  • Registration function that defines and registers all mailbox tools including reset_mailbox_password when called with the MCP instance.
    def register_mailbox_tools(mcp: FastMCP):

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