Hemodynamics · LIVE
MAGGIC heart-failure integer score
MAGGIC
Sum the Pocock 2013 MAGGIC integer chart from thirteen caller-supplied heart-failure predictors and return the published Table 4 1-year and 3-year death probabilities for scores 0-50.
Markdown: /docs/maggic.md · Canonical: https://magentlab.com/docs/maggic
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum the Pocock 2013 MAGGIC integer chart from thirteen caller-supplied heart-failure predictors and return the published Table 4 1-year and 3-year death probabilities for scores 0-50.
When to use
When an agent already has age, EF, NYHA class, creatinine, diabetes, beta-blocker and ACEI/ARB prescription, SBP, BMI, time since HF diagnosis, smoking, COPD, and sex and needs the published integer score, not a diagnosis, a treatment order, or a reason to withhold therapy.
When not to use
- Not a medical device and not a diagnosis. magent does not examine the patient, read an echocardiogram, assay creatinine, or prescribe therapy.
- Not a prognosis to withhold therapy. The integer score and Table 4 probabilities are published mappings, not a treatment order.
- Age and SBP extras follow the published integer chart rows that depend on EF. Those interactions are not dropped.
- Creatinine uses the Figure 2 µmol/L bins (Table 2 typesets mmol/L; the published values are µmol/L). magent does not compute eGFR.
- bmi_kg_m2 is caller-supplied. magent does not compute BMI from height and weight.
- Table 4 publishes 1-year and 3-year death probabilities for integer scores 0-50 only. Scores above 50 have no percentage in that table.
- Not NYHA class alone, not ACC/AHA HF stages, and not Framingham concurrent HF criteria.
Formula
MAGGIC integer score (Pocock 2013 Figure 2): EF <20 7, 20-24 6, 25-29 5, 30-34 3, 35-39 2, >=40 0; age extra by EF (<30 / 30-39 / >=40): <55 0/0/0, 55-59 1/2/3, 60-64 2/4/5, 65-69 4/6/7, 70-74 6/8/9, 75-79 8/10/12, >=80 10/13/15; SBP extra by EF: <110 5/3/2, 110-119 4/2/1, 120-129 3/1/1, 130-139 2/1/0, 140-149 1/0/0, >=150 0/0/0; BMI <15 6, 15-19 5, 20-24 3, 25-29 2, >=30 0; creatinine umol/L <90 0, 90-109 1, 110-129 2, 130-149 3, 150-169 4, 170-209 5, 210-249 6, >=250 8; NYHA I 0, II 2, III 6, IV 8; male 1; current smoker 1; diabetes 3; COPD 2; HF duration >18 months 2; not prescribed beta-blocker 3; not prescribed ACEI/ARB 1; Table 4 1-year and 3-year death probabilities for scores 0-50
Citation
- Authors
- Pocock SJ, Ariti CA, McMurray JJV, Maggioni A, Køber L, Squire IB, Swedberg K, Dobson J, Poppe KK, Whalley GA, Doughty RN
- Source
- Eur Heart J. 2013;34(19):1404-1413
Worked example
Young, high EF, NYHA I, treated, remaining factors at lowest integer row
Given:
acei_arb=trueage=50beta_blocker=truebmi_kg_m2=30copd=falsecreatinine_umol_l=80current_smoker=falsediabetes=falseef_percent=55hf_duration_gt_18_months=falsenyha_class=1sex=femalesystolic_mm_hg=150
- age 50 (<55) → 0 (any EF row)
- EF 55 (>=40) → 0
- NYHA I → 0
- creatinine 80 µmol/L (<90) → 0
- diabetes false → 0
- beta-blocker prescribed → 0
- SBP 150 (>=150, EF >=40) → 0
- BMI 30 (>=30) → 0
- HF duration not >18 months → 0
- not a current smoker → 0
- COPD false → 0
- female → 0
- ACEI/ARB prescribed → 0
- score = 0
- Table 4: 1-year 0.015, 3-year 0.039
Also searched as
- MAGGIC score
- MAGGIC heart failure risk
- Meta-Analysis Global Group in Chronic Heart Failure
- Pocock 2013 heart failure score
- HF integer risk score
- MAGGIC 1-year mortality
- MAGGIC 3-year mortality
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/maggic?age=50&ef_percent=55&nyha_class=1&creatinine_umol_l=80&diabetes=false&beta_blocker=true&systolic_mm_hg=150&bmi_kg_m2=30&hf_duration_gt_18_months=false¤t_smoker=false&copd=false&sex=female&acei_arb=true
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/maggic?age=50&ef_percent=55&nyha_class=1&creatinine_umol_l=80&diabetes=false&beta_blocker=true&systolic_mm_hg=150&bmi_kg_m2=30&hf_duration_gt_18_months=false¤t_smoker=false&copd=false&sex=female&acei_arb=true"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (integer 18-120). Pocock 2013 integer extra depends on EF: <55 scores 0; then 55-59, 60-64, 65-69, 70-74, 75-79, >=80. magent does not examine the patient. |
ef_percent |
number | required | Left-ventricular ejection fraction in percent (1-90). Figure 2: <20 scores 7; 20-24 6; 25-29 5; 30-34 3; 35-39 2; >=40 0. Also selects the age and SBP extra rows. magent does not read an echocardiogram. |
nyha_class |
integer | required | NYHA class 1-4 as assigned by the caller (Figure 2: I 0, II 2, III 6, IV 8). magent does not assign NYHA class. |
creatinine_umol_l |
number | optional | Serum creatinine in µmol/L (9-1768), the Figure 2 unit. Provide this or creatinine_mg_dl, not both. Bins: <90 0; 90-109 1; 110-129 2; 130-149 3; 150-169 4; 170-209 5; 210-249 6; >=250 8. magent does not assay creatinine. |
creatinine_mg_dl |
number | optional | Serum creatinine in mg/dL (0.1-20). Converted as µmol/L = mg/dL × 88.42, then Figure 2 µmol/L bins. Provide this or creatinine_umol_l, not both. |
diabetes |
boolean | required | Diabetes as assigned by the caller. true scores 3 (Figure 2). magent does not diagnose diabetes. |
beta_blocker |
boolean | required | Prescribed a beta-blocker as assigned by the caller. true scores 0; false (not prescribed) scores 3. magent does not prescribe therapy. |
systolic_mm_hg |
number | required | Systolic blood pressure in mm Hg (50-250). Figure 2 extra depends on EF: <110, 110-119, 120-129, 130-139, 140-149, >=150. magent does not measure blood pressure. |
bmi_kg_m2 |
number | required | Caller-supplied body-mass index in kg/m² (10-80). Figure 2: <15 6; 15-19 5; 20-24 3; 25-29 2; >=30 0. magent does not compute BMI from height and weight. |
hf_duration_gt_18_months |
boolean | required | Heart-failure duration greater than 18 months as assigned by the caller (Table 2 HF duration >18 months). true scores 2. magent does not date the diagnosis. |
current_smoker |
boolean | required | Current smoker as assigned by the caller. true scores 1. magent does not take a smoking history. |
copd |
boolean | required | COPD as assigned by the caller. true scores 2. magent does not diagnose COPD. |
sex |
string | required · female, male | Sex (female or male). Male scores 1 (Figure 2). |
acei_arb |
boolean | required | Prescribed an ACE inhibitor or ARB as assigned by the caller. true scores 0; false (not prescribed) scores 1. magent does not prescribe therapy. |
Bulk (POST)
POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.
Example request (fixture)
{
"items": [
{
"acei_arb": "true",
"age": "50",
"beta_blocker": "true",
"bmi_kg_m2": "30",
"copd": "false",
"creatinine_umol_l": "80",
"current_smoker": "false",
"diabetes": "false",
"ef_percent": "55",
"hf_duration_gt_18_months": "false",
"nyha_class": "1",
"sex": "female",
"systolic_mm_hg": "150"
},
{
"acei_arb": "true",
"age": "50",
"beta_blocker": "true",
"bmi_kg_m2": "30",
"copd": "false",
"creatinine_umol_l": "80",
"current_smoker": "false",
"diabetes": "false",
"ef_percent": "55",
"hf_duration_gt_18_months": "false",
"nyha_class": "1",
"sex": "female",
"systolic_mm_hg": "150"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"count": 2,
"path": "/api/calc/maggic",
"items": [
{
"components": [
{
"value": 55.0,
"factor": "ef",
"points": 0,
"present": false
},
{
"value": 50,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 150.0,
"factor": "systolic_mm_hg",
"points": 0,
"present": false
},
{
"value": 30.0,
"factor": "bmi",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "creatinine",
"points": 0,
"present": false
},
{
"value": 1,
"factor": "nyha_class",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_beta_blocker",
"points": 0,
"present": false
},
{
"factor": "hf_duration_gt_18_months",
"points": 0,
"present": false
},
{
"factor": "current_smoker",
"points": 0,
"present": false
},
{
"factor": "copd",
"points": 0,
"present": false
},
{
"factor": "male_sex",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_acei_arb",
"points": 0,
"present": false
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Pocock SJ, Ariti CA, McMurray JJV, Maggioni A, Køber L, Squire IB, Swedberg K, Dobson J, Poppe KK, Whalley GA, Doughty RN",
"doi": "10.1093/eurheartj/ehs337",
"id": "pocock-2013",
"pmid": "23186806",
"source": "Eur Heart J. 2013;34(19):1404-1413",
"title": "Predicting survival in heart failure: a risk score based on 39 372 patients from 30 studies"
},
"formula": "maggic",
"formula_expression": "MAGGIC integer score (Pocock 2013 Figure 2): EF <20 7, 20-24 6, 25-29 5, 30-34 3, 35-39 2, >=40 0; age extra by EF (<30 / 30-39 / >=40): <55 0/0/0, 55-59 1/2/3, 60-64 2/4/5, 65-69 4/6/7, 70-74 6/8/9, 75-79 8/10/12, >=80 10/13/15; SBP extra by EF: <110 5/3/2, 110-119 4/2/1, 120-129 3/1/1, 130-139 2/1/0, 140-149 1/0/0, >=150 0/0/0; BMI <15 6, 15-19 5, 20-24 3, 25-29 2, >=30 0; creatinine umol/L <90 0, 90-109 1, 110-129 2, 130-149 3, 150-169 4, 170-209 5, 210-249 6, >=250 8; NYHA I 0, II 2, III 6, IV 8; male 1; current smoker 1; diabetes 3; COPD 2; HF duration >18 months 2; not prescribed beta-blocker 3; not prescribed ACEI/ARB 1; Table 4 1-year and 3-year death probabilities for scores 0-50",
"systolic_mm_hg": 150.0,
"age_years": 50,
"score": 0,
"sex": "female",
"bmi_kg_m2": 30.0,
"creatinine_umol_l": 80.0,
"diabetes": false,
"acei_arb": true,
"beta_blocker": true,
"copd": false,
"current_smoker": false,
"ef_percent": 55.0,
"hf_duration_gt_18_months": false,
"nyha_class": 1,
"death_probability_1y": 0.015,
"death_probability_3y": 0.039
},
{
"components": [
{
"value": 55.0,
"factor": "ef",
"points": 0,
"present": false
},
{
"value": 50,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 150.0,
"factor": "systolic_mm_hg",
"points": 0,
"present": false
},
{
"value": 30.0,
"factor": "bmi",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "creatinine",
"points": 0,
"present": false
},
{
"value": 1,
"factor": "nyha_class",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_beta_blocker",
"points": 0,
"present": false
},
{
"factor": "hf_duration_gt_18_months",
"points": 0,
"present": false
},
{
"factor": "current_smoker",
"points": 0,
"present": false
},
{
"factor": "copd",
"points": 0,
"present": false
},
{
"factor": "male_sex",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_acei_arb",
"points": 0,
"present": false
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Pocock SJ, Ariti CA, McMurray JJV, Maggioni A, Køber L, Squire IB, Swedberg K, Dobson J, Poppe KK, Whalley GA, Doughty RN",
"doi": "10.1093/eurheartj/ehs337",
"id": "pocock-2013",
"pmid": "23186806",
"source": "Eur Heart J. 2013;34(19):1404-1413",
"title": "Predicting survival in heart failure: a risk score based on 39 372 patients from 30 studies"
},
"formula": "maggic",
"formula_expression": "MAGGIC integer score (Pocock 2013 Figure 2): EF <20 7, 20-24 6, 25-29 5, 30-34 3, 35-39 2, >=40 0; age extra by EF (<30 / 30-39 / >=40): <55 0/0/0, 55-59 1/2/3, 60-64 2/4/5, 65-69 4/6/7, 70-74 6/8/9, 75-79 8/10/12, >=80 10/13/15; SBP extra by EF: <110 5/3/2, 110-119 4/2/1, 120-129 3/1/1, 130-139 2/1/0, 140-149 1/0/0, >=150 0/0/0; BMI <15 6, 15-19 5, 20-24 3, 25-29 2, >=30 0; creatinine umol/L <90 0, 90-109 1, 110-129 2, 130-149 3, 150-169 4, 170-209 5, 210-249 6, >=250 8; NYHA I 0, II 2, III 6, IV 8; male 1; current smoker 1; diabetes 3; COPD 2; HF duration >18 months 2; not prescribed beta-blocker 3; not prescribed ACEI/ARB 1; Table 4 1-year and 3-year death probabilities for scores 0-50",
"systolic_mm_hg": 150.0,
"age_years": 50,
"score": 0,
"sex": "female",
"bmi_kg_m2": 30.0,
"creatinine_umol_l": 80.0,
"diabetes": false,
"acei_arb": true,
"beta_blocker": true,
"copd": false,
"current_smoker": false,
"ef_percent": 55.0,
"hf_duration_gt_18_months": false,
"nyha_class": 1,
"death_probability_1y": 0.015,
"death_probability_3y": 0.039
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | maggic |
formula_expression |
string | Exact expression used |
age_years |
integer | Age in years used |
ef_percent |
number | Ejection fraction used, percent |
nyha_class |
integer | Caller-assigned NYHA class 1-4 used |
creatinine_umol_l |
number | Serum creatinine used, µmol/L (after conversion if mg/dL was supplied) |
diabetes |
boolean | Diabetes flag used |
beta_blocker |
boolean | Prescribed beta-blocker flag used |
systolic_mm_hg |
number | Systolic BP used, mm Hg |
bmi_kg_m2 |
number | Caller-supplied BMI used, kg/m² |
hf_duration_gt_18_months |
boolean | HF duration >18 months flag used |
current_smoker |
boolean | Current-smoker flag used |
copd |
boolean | COPD flag used |
sex |
string | female or male used |
acei_arb |
boolean | Prescribed ACEI/ARB flag used |
score |
integer | Pocock 2013 MAGGIC integer score |
death_probability_1y |
number | Table 4 1-year probability of death for scores 0-50. Omitted when score >50. |
death_probability_3y |
number | Table 4 3-year probability of death for scores 0-50. Omitted when score >50. |
components |
array | Per-predictor integer points |
citation |
object | Pocock 2013 Eur Heart J citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 55.0,
"factor": "ef",
"points": 0,
"present": false
},
{
"value": 50,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 150.0,
"factor": "systolic_mm_hg",
"points": 0,
"present": false
},
{
"value": 30.0,
"factor": "bmi",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "creatinine",
"points": 0,
"present": false
},
{
"value": 1,
"factor": "nyha_class",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_beta_blocker",
"points": 0,
"present": false
},
{
"factor": "hf_duration_gt_18_months",
"points": 0,
"present": false
},
{
"factor": "current_smoker",
"points": 0,
"present": false
},
{
"factor": "copd",
"points": 0,
"present": false
},
{
"factor": "male_sex",
"points": 0,
"present": false
},
{
"factor": "not_prescribed_acei_arb",
"points": 0,
"present": false
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Pocock SJ, Ariti CA, McMurray JJV, Maggioni A, Køber L, Squire IB, Swedberg K, Dobson J, Poppe KK, Whalley GA, Doughty RN",
"doi": "10.1093/eurheartj/ehs337",
"id": "pocock-2013",
"pmid": "23186806",
"source": "Eur Heart J. 2013;34(19):1404-1413",
"title": "Predicting survival in heart failure: a risk score based on 39 372 patients from 30 studies"
},
"formula": "maggic",
"formula_expression": "MAGGIC integer score (Pocock 2013 Figure 2): EF <20 7, 20-24 6, 25-29 5, 30-34 3, 35-39 2, >=40 0; age extra by EF (<30 / 30-39 / >=40): <55 0/0/0, 55-59 1/2/3, 60-64 2/4/5, 65-69 4/6/7, 70-74 6/8/9, 75-79 8/10/12, >=80 10/13/15; SBP extra by EF: <110 5/3/2, 110-119 4/2/1, 120-129 3/1/1, 130-139 2/1/0, 140-149 1/0/0, >=150 0/0/0; BMI <15 6, 15-19 5, 20-24 3, 25-29 2, >=30 0; creatinine umol/L <90 0, 90-109 1, 110-129 2, 130-149 3, 150-169 4, 170-209 5, 210-249 6, >=250 8; NYHA I 0, II 2, III 6, IV 8; male 1; current smoker 1; diabetes 3; COPD 2; HF duration >18 months 2; not prescribed beta-blocker 3; not prescribed ACEI/ARB 1; Table 4 1-year and 3-year death probabilities for scores 0-50",
"systolic_mm_hg": 150.0,
"age_years": 50,
"score": 0,
"sex": "female",
"bmi_kg_m2": 30.0,
"creatinine_umol_l": 80.0,
"diabetes": false,
"acei_arb": true,
"beta_blocker": true,
"copd": false,
"current_smoker": false,
"ef_percent": 55.0,
"hf_duration_gt_18_months": false,
"nyha_class": 1,
"death_probability_1y": 0.015,
"death_probability_3y": 0.039
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_maggic |
MAGGIC inputs must be the thirteen Pocock 2013 integer-score variables from that paper (age, EF, NYHA, creatinine, diabetes, beta-blocker, SBP, BMI, diagnosis duration, smoker, COPD, sex, ACEI/ARB). Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- ACCF/AHA HF stages — Apply the 2013 ACCF/AHA heart-failure stages (Yancy) from caller-assigned high-risk, structural heart disease, prior or current HF symptoms, and refractory specialized-care flags. Returns hf_stage A, B, C, D, or not_staged.
- Framingham HF criteria — Apply the McKee 1971 Framingham concurrent major and minor criteria and return definite or not_definite from nine major flags, seven minor flags, and the dual weight-loss flag.
Payment
Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /docs/mcp.
Guarantees
- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.