def METHOD_NAME(client, organization, domain):
    """Run a server operation to check if a domain belongs to an organization."""
    op = Operation(SortingHatSchema.Query)
    filters = SortingHatSchema.OrganizationFilterType(name=organization)
    op.organizations(filters=filters)
    op.organizations.page_info.total_results()
    op.organizations.entities.domains.domain()
    result = client.execute(op)
    data = op + result
    total = data.organizations.page_info.total_results
    if total == 0:
        error = "{} not found in the registry".format(organization)
        exc = click.ClickException(error)
        exc.exit_code = 9
        raise exc
    org_domains = data.organizations.entities[0].domains
    found_domains = [domain.domain for domain in org_domains]
    if domain not in found_domains:
        error = "{} not found in the registry".format(domain)
        exc = click.ClickException(error)
        exc.exit_code = 9
        raise exc