ACS · LIVE
GRACE in-hospital ACS score
GRACE
Sum the Granger 2003 in-hospital GRACE 1.0 nomogram points from eight admission predictors and return that paper's printed in-hospital mortality readout.
Markdown: /docs/grace.md · Canonical: https://magentlab.com/docs/grace
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum the Granger 2003 in-hospital GRACE 1.0 nomogram points from eight admission predictors and return that paper's printed in-hospital mortality readout.
When to use
When an agent already has age, heart rate, systolic BP, creatinine, Killip class, cardiac arrest, ST-segment deviation, and initial enzyme flags and needs the Granger 2003 in-hospital point total, not a catheterization order.
When not to use
- Not a medical device.
- Not a cath-lab order, reperfusion protocol, or diagnosis of ACS. magent does not interpret the ECG or assign Killip class.
- Granger 2003 in-hospital GRACE 1.0 integer nomogram only. Not the later continuous GRACE 2.0 model. Not Fox 2006 6-month mortality. Not Eagle 2004 post-discharge.
- Does not apply later ESC NSTE-ACS ≤108 / 109-140 / >140 cutoffs; those bands are not printed in Granger 2003. in_hospital_mortality_percent is the 2003 nomogram readout (≤60 → 0.2%; labeled 70-240 percents at or below the total; ≥250 → 52%).
- Cardiac arrest, ST-segment deviation, and elevated enzymes are caller-assigned flags. magent does not read the chart or the laboratory.
Formula
GRACE = age_points(<30:0, 30-39:8, 40-49:25, 50-59:41, 60-69:58, 70-79:75, 80-89:91, >=90:100) + heart_rate_points(<50:0, 50-69:3, 70-89:9, 90-109:15, 110-149:24, 150-199:38, >=200:46) + sbp_points(<80:58, 80-99:53, 100-119:43, 120-139:34, 140-159:24, 160-199:10, >=200:0) + creatinine_mg_dl_points(0-0.39:1, 0.4-0.79:4, 0.8-1.19:7, 1.2-1.59:10, 1.6-1.99:13, 2.0-3.99:21, >=4:28) + killip(1:0, 2:20, 3:39, 4:59) + 39 if cardiac_arrest + 28 if st_deviation + 14 if elevated_enzymes; Granger 2003 in-hospital GRACE 1.0 nomogram; max 372; in_hospital_mortality_percent is that paper's printed score readout (score<=60 → 0.2; then the labeled 70-240 percents at or below the total; score>=250 → 52); not ESC 108/140 cutoffs, not GRACE 2.0, not Fox 2006 6-month
Citation
- Authors
- Granger CB, Goldberg RJ, Dabbous O, Pieper KS, Eagle KA, Cannon CP, Van De Werf F, Avezum A, Goodman SG, Flather MD, Fox KA; Global Registry of Acute Coronary Events Investigators
- Source
- Arch Intern Med. 2003;163(19):2345-2353
Worked example
Typical NSTE-ACS, Killip I, no arrest, no ST deviation, negative enzymes
Given:
age=65cardiac_arrest=falsecreatinine_mg_dl=1.0elevated_enzymes=falseheart_rate_bpm=80killip_class=1sbp_mm_hg=130st_deviation=false
- age 65 → 58 (60-69 band)
- heart_rate_bpm 80 → 9 (70-89 band)
- sbp_mm_hg 130 → 34 (120-139 band)
- creatinine_mg_dl 1.0 → 7 (0.8-1.19 band)
- killip_class 1 → 0; cardiac_arrest false → 0; st_deviation false → 0; elevated_enzymes false → 0
- Score = 108 (max 372); in_hospital_mortality_percent = 0.8 (printed 100 → 0.8%)
Older ACS with Killip III, ST deviation, and elevated enzymes
Given:
age=80cardiac_arrest=falsecreatinine_mg_dl=2.2elevated_enzymes=trueheart_rate_bpm=110killip_class=3sbp_mm_hg=90st_deviation=true
- age 80 → 91; heart_rate_bpm 110 → 24; sbp_mm_hg 90 → 53; creatinine_mg_dl 2.2 → 21
- killip_class 3 → 39; cardiac_arrest false → 0; st_deviation true → 28; elevated_enzymes true → 14
- Score = 270 (max 372); in_hospital_mortality_percent = 52.0 (printed ≥250 → ≥52%)
Also searched as
- GRACE score
- GRACE in-hospital
- Granger 2003
- ACS in-hospital mortality
- Global Registry of Acute Coronary Events
- GRACE 1.0
- in-hospital GRACE
- Killip GRACE ACS
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/grace?age=65&heart_rate_bpm=80&sbp_mm_hg=130&creatinine_mg_dl=1.0&killip_class=1&cardiac_arrest=false&st_deviation=false&elevated_enzymes=false
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/grace?age=65&heart_rate_bpm=80&sbp_mm_hg=130&creatinine_mg_dl=1.0&killip_class=1&cardiac_arrest=false&st_deviation=false&elevated_enzymes=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). Granger 2003 nomogram: <30 scores 0; 30-39 scores 8; 40-49 scores 25; 50-59 scores 41; 60-69 scores 58; 70-79 scores 75; 80-89 scores 91; ≥90 scores 100. |
heart_rate_bpm |
integer | required | Heart rate in beats/min (20-300). Granger 2003 nomogram: <50 scores 0; 50-69 scores 3; 70-89 scores 9; 90-109 scores 15; 110-149 scores 24; 150-199 scores 38; ≥200 scores 46. |
sbp_mm_hg |
integer | required | Systolic blood pressure in mm Hg (40-300). Granger 2003 nomogram, inverse: <80 scores 58; 80-99 scores 53; 100-119 scores 43; 120-139 scores 34; 140-159 scores 24; 160-199 scores 10; ≥200 scores 0. |
creatinine_mg_dl |
number | optional | Initial serum creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l. If both are sent, creatinine_mg_dl is scored. Granger 2003 nomogram: 0.0-0.39 scores 1; 0.4-0.79 scores 4; 0.8-1.19 scores 7; 1.2-1.59 scores 10; 1.6-1.99 scores 13; 2.0-3.99 scores 21; ≥4.0 scores 28. |
creatinine_umol_l |
number | optional | Initial serum creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42. Alternate to creatinine_mg_dl. Ignored when creatinine_mg_dl is present. |
killip_class |
integer | required | Killip class 1-4 as assigned by the caller (1 no heart failure scores 0; 2 rales or elevated venous pressure scores 20; 3 pulmonary edema scores 39; 4 cardiogenic shock scores 59). magent does not examine the patient. |
cardiac_arrest |
boolean | required | Cardiac arrest at presentation as assigned by the caller (Granger 2003). true scores 39. magent does not read the chart. true or false. |
st_deviation |
boolean | required | ST-segment deviation on the presenting ECG as assigned by the caller (Granger 2003). true scores 28. magent does not interpret the ECG. true or false. |
elevated_enzymes |
boolean | required | Elevated initial cardiac enzymes as assigned by the caller (Granger 2003). true scores 14. magent does not read the laboratory. true or false. |
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": [
{
"age": "65",
"cardiac_arrest": "false",
"creatinine_mg_dl": "1.0",
"elevated_enzymes": "false",
"heart_rate_bpm": "80",
"killip_class": "1",
"sbp_mm_hg": "130",
"st_deviation": "false"
},
{
"age": "65",
"cardiac_arrest": "false",
"creatinine_mg_dl": "1.0",
"elevated_enzymes": "false",
"heart_rate_bpm": "80",
"killip_class": "1",
"sbp_mm_hg": "130",
"st_deviation": "false"
}
]
}
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/grace",
"items": [
{
"components": [
{
"value": 65,
"factor": "age",
"points": 58,
"present": true
},
{
"value": 80,
"factor": "heart_rate_bpm",
"points": 9,
"present": true
},
{
"value": 130,
"factor": "sbp_mm_hg",
"points": 34,
"present": true
},
{
"value": 1.0,
"factor": "creatinine_mg_dl",
"points": 7,
"present": true
},
{
"value": 1,
"factor": "killip_class",
"points": 0,
"present": false
},
{
"factor": "cardiac_arrest",
"points": 0,
"present": false
},
{
"factor": "st_deviation",
"points": 0,
"present": false
},
{
"factor": "elevated_enzymes",
"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": "Granger CB, Goldberg RJ, Dabbous O, Pieper KS, Eagle KA, Cannon CP, Van De Werf F, Avezum A, Goodman SG, Flather MD, Fox KA; Global Registry of Acute Coronary Events Investigators",
"doi": "10.1001/archinte.163.19.2345",
"id": "granger-2003-grace",
"pmid": "14581255",
"source": "Arch Intern Med. 2003;163(19):2345-2353",
"title": "Predictors of hospital mortality in the global registry of acute coronary events"
},
"formula": "grace",
"formula_expression": "GRACE = age_points(<30:0, 30-39:8, 40-49:25, 50-59:41, 60-69:58, 70-79:75, 80-89:91, >=90:100) + heart_rate_points(<50:0, 50-69:3, 70-89:9, 90-109:15, 110-149:24, 150-199:38, >=200:46) + sbp_points(<80:58, 80-99:53, 100-119:43, 120-139:34, 140-159:24, 160-199:10, >=200:0) + creatinine_mg_dl_points(0-0.39:1, 0.4-0.79:4, 0.8-1.19:7, 1.2-1.59:10, 1.6-1.99:13, 2.0-3.99:21, >=4:28) + killip(1:0, 2:20, 3:39, 4:59) + 39 if cardiac_arrest + 28 if st_deviation + 14 if elevated_enzymes; Granger 2003 in-hospital GRACE 1.0 nomogram; max 372; in_hospital_mortality_percent is that paper's printed score readout (score<=60 → 0.2; then the labeled 70-240 percents at or below the total; score>=250 → 52); not ESC 108/140 cutoffs, not GRACE 2.0, not Fox 2006 6-month",
"max_score": 372,
"score": 108,
"age_years": 65,
"creatinine_mg_dl": 1.0,
"heart_rate_bpm": 80,
"sbp_mm_hg": 130,
"cardiac_arrest": false,
"elevated_enzymes": false,
"in_hospital_mortality_percent": 0.8,
"killip_class": 1,
"st_deviation": false
},
{
"components": [
{
"value": 65,
"factor": "age",
"points": 58,
"present": true
},
{
"value": 80,
"factor": "heart_rate_bpm",
"points": 9,
"present": true
},
{
"value": 130,
"factor": "sbp_mm_hg",
"points": 34,
"present": true
},
{
"value": 1.0,
"factor": "creatinine_mg_dl",
"points": 7,
"present": true
},
{
"value": 1,
"factor": "killip_class",
"points": 0,
"present": false
},
{
"factor": "cardiac_arrest",
"points": 0,
"present": false
},
{
"factor": "st_deviation",
"points": 0,
"present": false
},
{
"factor": "elevated_enzymes",
"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": "Granger CB, Goldberg RJ, Dabbous O, Pieper KS, Eagle KA, Cannon CP, Van De Werf F, Avezum A, Goodman SG, Flather MD, Fox KA; Global Registry of Acute Coronary Events Investigators",
"doi": "10.1001/archinte.163.19.2345",
"id": "granger-2003-grace",
"pmid": "14581255",
"source": "Arch Intern Med. 2003;163(19):2345-2353",
"title": "Predictors of hospital mortality in the global registry of acute coronary events"
},
"formula": "grace",
"formula_expression": "GRACE = age_points(<30:0, 30-39:8, 40-49:25, 50-59:41, 60-69:58, 70-79:75, 80-89:91, >=90:100) + heart_rate_points(<50:0, 50-69:3, 70-89:9, 90-109:15, 110-149:24, 150-199:38, >=200:46) + sbp_points(<80:58, 80-99:53, 100-119:43, 120-139:34, 140-159:24, 160-199:10, >=200:0) + creatinine_mg_dl_points(0-0.39:1, 0.4-0.79:4, 0.8-1.19:7, 1.2-1.59:10, 1.6-1.99:13, 2.0-3.99:21, >=4:28) + killip(1:0, 2:20, 3:39, 4:59) + 39 if cardiac_arrest + 28 if st_deviation + 14 if elevated_enzymes; Granger 2003 in-hospital GRACE 1.0 nomogram; max 372; in_hospital_mortality_percent is that paper's printed score readout (score<=60 → 0.2; then the labeled 70-240 percents at or below the total; score>=250 → 52); not ESC 108/140 cutoffs, not GRACE 2.0, not Fox 2006 6-month",
"max_score": 372,
"score": 108,
"age_years": 65,
"creatinine_mg_dl": 1.0,
"heart_rate_bpm": 80,
"sbp_mm_hg": 130,
"cardiac_arrest": false,
"elevated_enzymes": false,
"in_hospital_mortality_percent": 0.8,
"killip_class": 1,
"st_deviation": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | grace |
formula_expression |
string | Exact expression used |
score |
integer | Total Granger 2003 nomogram points 1-372 |
max_score |
integer | 372 (100+46+58+28+59+39+28+14) |
in_hospital_mortality_percent |
number | Granger 2003 printed in-hospital mortality percent for this total (≤60 → 0.2; labeled 70-240 ticks at or below the score; ≥250 → 52). Not an ESC 108/140 band and not an individual prognosis. |
age_years |
integer | Age used |
heart_rate_bpm |
integer | Heart rate used |
sbp_mm_hg |
integer | Systolic BP used |
creatinine_mg_dl |
number | Serum creatinine used in mg/dL (after µmol/L conversion when that unit is sent) |
killip_class |
integer | Caller-assigned Killip class 1-4 used |
cardiac_arrest |
boolean | Caller-assigned cardiac arrest at presentation used |
st_deviation |
boolean | Caller-assigned ST-segment deviation used |
elevated_enzymes |
boolean | Caller-assigned elevated initial enzymes used |
components |
array | Per-predictor nomogram points |
citation |
object | Granger 2003 Arch Intern Med citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 65,
"factor": "age",
"points": 58,
"present": true
},
{
"value": 80,
"factor": "heart_rate_bpm",
"points": 9,
"present": true
},
{
"value": 130,
"factor": "sbp_mm_hg",
"points": 34,
"present": true
},
{
"value": 1.0,
"factor": "creatinine_mg_dl",
"points": 7,
"present": true
},
{
"value": 1,
"factor": "killip_class",
"points": 0,
"present": false
},
{
"factor": "cardiac_arrest",
"points": 0,
"present": false
},
{
"factor": "st_deviation",
"points": 0,
"present": false
},
{
"factor": "elevated_enzymes",
"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": "Granger CB, Goldberg RJ, Dabbous O, Pieper KS, Eagle KA, Cannon CP, Van De Werf F, Avezum A, Goodman SG, Flather MD, Fox KA; Global Registry of Acute Coronary Events Investigators",
"doi": "10.1001/archinte.163.19.2345",
"id": "granger-2003-grace",
"pmid": "14581255",
"source": "Arch Intern Med. 2003;163(19):2345-2353",
"title": "Predictors of hospital mortality in the global registry of acute coronary events"
},
"formula": "grace",
"formula_expression": "GRACE = age_points(<30:0, 30-39:8, 40-49:25, 50-59:41, 60-69:58, 70-79:75, 80-89:91, >=90:100) + heart_rate_points(<50:0, 50-69:3, 70-89:9, 90-109:15, 110-149:24, 150-199:38, >=200:46) + sbp_points(<80:58, 80-99:53, 100-119:43, 120-139:34, 140-159:24, 160-199:10, >=200:0) + creatinine_mg_dl_points(0-0.39:1, 0.4-0.79:4, 0.8-1.19:7, 1.2-1.59:10, 1.6-1.99:13, 2.0-3.99:21, >=4:28) + killip(1:0, 2:20, 3:39, 4:59) + 39 if cardiac_arrest + 28 if st_deviation + 14 if elevated_enzymes; Granger 2003 in-hospital GRACE 1.0 nomogram; max 372; in_hospital_mortality_percent is that paper's printed score readout (score<=60 → 0.2; then the labeled 70-240 percents at or below the total; score>=250 → 52); not ESC 108/140 cutoffs, not GRACE 2.0, not Fox 2006 6-month",
"max_score": 372,
"score": 108,
"age_years": 65,
"creatinine_mg_dl": 1.0,
"heart_rate_bpm": 80,
"sbp_mm_hg": 130,
"cardiac_arrest": false,
"elevated_enzymes": false,
"in_hospital_mortality_percent": 0.8,
"killip_class": 1,
"st_deviation": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_grace |
GRACE in-hospital inputs must match Granger 2003 age, heart rate, SBP, creatinine, Killip class, cardiac arrest, ST deviation, and enzyme flags. Returned before settlement; you are not charged. |
| 400 | invalid_flag |
boolean clinical flags must be true or false 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
- TIMI risk score for STEMI — Compute the TIMI risk score for ST-elevation myocardial infarction from published bedside factors at presentation.
- TIMI UA/NSTEMI — Compute the TIMI risk score for unstable angina / NSTEMI from age and six caller-assigned flags.
- HEART score — Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).
- Killip — Return the Killip and Kimball 1967 myocardial-infarction heart-failure class 1-4 from a caller-assigned integer, with the published class description and 1967 CCU hospital mortality.
- ORBI — Sum the Auffret 2018 ORBI predictors after STEMI primary PCI and return the integer score (0-36), class I-IV, and derivation-cohort in-hospital cardiogenic-shock percent.
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.