Check lab QC values against Westgard rules
check_qc_westgardUse when someone has quality control (QC) results for a lab or point-of-care test and wants to know whether they break Westgard rules or how they look on a Levey-Jennings chart (e.g. 'do these control values fail any Westgard rules?', 'check my QC: mean 5.0, SD 0.1, values ...', 'is this a 2-2s or 4-1s violation?'). Takes control values in run order plus the target mean and SD (or computes them from the values if the user asks) and evaluates 1-2s (warning), 1-3s, 2-2s, R-4s, 4-1s and 10x. Returns z-scores, the rule hits for each point and a plain summary, and draws a Levey-Jennings chart in ChatGPT and Claude. Up to 500 values. QC statistics only: not a clinical interpretation of any patient result.
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": {
"values": "<values>"
},
"name": "check_qc_westgard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sd | No | Target SD for this control lot and level. | |
| mean | No | Target mean for this control lot and level. | |
| level | No | Control level, e.g. 'level 1'. | |
| units | No | Units of the values. | |
| values | Yes | Control values in run order, oldest first. | |
| analyte | No | Test or analyte name, e.g. 'glucose'. | |
| compute_from_values | No | True only if the user asks to compute the mean and SD from the values. |