def METHOD_NAME(pid_type, pid, entity_type='agents', verbose=False,
                         with_deleted=True, resolve=True, sources=True):
    """Request MEF REST API in JSON format.
    :param pid_type: the type of entity (idref, gnd, viaf, ...)
    :param pid: the entity pid into authority source
    :param entity_type: the entity type
    :param verbose: is messages should be logged
    :param with_deleted: is the deleted entity should be search for.
    :param resolve: is references should be resolved from source
    :param sources: is sources should be included into response.
    :returns: corresponding entity metadata from authority server
    :rtype dict
    """
    # Depending on the entity type, try to get the correct MEF base URL.
    # If no base URL could be found, a key error will be raised
    if not (base_url := get_mef_url(entity_type)):
        msg = f'Unable to find MEF base url for {entity_type}'
        if verbose:
            current_app.logger.warning(msg)
        raise KeyError(msg)
    if pid_type == 'mef':
        mef_url = f'{base_url}/mef/?q=pid:"{pid}"'
    elif pid_type == 'viaf':
        mef_url = f'{base_url}/mef/?q=viaf_pid:"{pid}"'
    else:
        mef_url = f'{base_url}/mef/latest/{pid_type}:{pid}'
    request = requests_retry_session().get(url=mef_url, params={
        'with_deleted': int(with_deleted),
        'resolve': int(resolve),
        'sources': int(sources)
    })
    if request.status_code == requests_codes.ok:
        try:
            json_data = request.json()
            if hits := json_data.get('hits', {}):
                # we got an ES response
                data = hits.get('hits', [None])[0].get('metadata', {})
            else:
                # we got an DB response
                data = json_data
                data.pop('_created', None)
                data.pop('_updated', None)
            # TODO :: This `if` statement should be removed when MEF will
            #         return the `type` key for concept
            if entity_type == 'concepts':
                data.setdefault('type', EntityType.TOPIC)
            return remove_schema(data)
        except Exception as err:
            msg = f'MEF resolver no metadata: {mef_url} {err}'
            if verbose:
                current_app.logger.warning(msg)
            raise ValueError(msg) from err
    else:
        msg = f'Mef http error: {request.status_code} {mef_url}'
        if verbose:
            current_app.logger.error(msg)
        raise RequestException(msg)