Set Kpi Alert Rule
set_kpi_alert_ruleConfigure KPI alert rules on a model project to trigger alerts when monitored accuracy, drift, or fairness metrics cross defined thresholds.
Instructions
Set a KPI alert rule on a model project: alert when a monitoring KPI crosses a threshold.
Model Manager checks the project's models against its rules whenever
their KPIs are calculated (run_performance_definition) and lists
them as the project's KPI rules. kpi is one of:
accuracy:
AUC,misclassification,TPR,FPR,F1,ASE,RASE,R-squared,global accuracy, cumulative lift_Cumlift5_to_Cumlift30_, or the KPI namesget_project_kpislists;drift:
devIndex(the deviation index) of each variable invariables, input or output — one rule per variable;fairness:
EqualOpportunity,DemographicParity,PredictiveParity,EqualAccuracyorEqualizedOddsfor the sensitive variable invariables.
operator is greaterThan (alert above the threshold, as for
misclassification or drift) or lessThan (alert below it, as for
AUC). A rule for the same KPI, variable and direction is updated, not
duplicated; alert_rule_id updates a given rule, its direction too.
The result says whether the champion breaks the rule now.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"kpi": "<kpi>",
"operator": "<operator>",
"threshold": "<threshold>"
},
"name": "set_kpi_alert_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kpi | Yes | The KPI to watch. | |
| name | No | The rule's name (default as Model Manager names it, "AUC Less than 0.9"); ``{variable}`` is replaced by each variable. | |
| operator | Yes | ``greaterThan`` or ``lessThan``. | |
| severity | No | ``low``, ``medium`` (default) or ``high``: Model Manager's priority. | medium |
| threshold | Yes | The value the KPI should not cross. | |
| variables | No | The variables of a drift or fairness KPI. | |
| project_id | Yes | The project. | |
| occurrences | No | Alert after this many occurrences (default 1). | |
| alert_rule_id | No | A rule to update instead. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||