def METHOD_NAME(agent_id: int) -> Result:
    data = {
        "enableAutoFallback": True,
        "performanceLimitRiskMaxMetricsCount": 30,
    }
    interval_list: list[int] = []
    for mg in MetricGroup:
        res = get_agent_config_by_scan(agent_id, mg)
        if isinstance(res, Err):
            continue
        config_id = res.value
        config = IastCircuitConfig.objects.filter(pk=config_id).first()
        if not config:
            continue
        metric_list = [
            convert_metric(metric) for metric in IastCircuitMetric.objects.filter(circuit_config_id=config.id).all()
        ]
        data[mg.name.lower()] = metric_list
        data[mg.name.lower() + "IsUninstall"] = False
        interval_list.append(config.interval)
    # if interval_list is [], there is mean no config found here.
    # because interval is required in create config.
    if not interval_list:
        return Err("No config found")
    data["performanceLimitRiskMaxMetricsCount"] = min(interval_list)
    return Ok(data)