# HEART Score Calculator

> HEART Score Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Computes the HEART score for emergency chest pain risk stratification from caller-assigned age, history, ECG, risk factors, and troponin values, returning a total (0-10) and risk band per Six 2008.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/heart
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/heart-score-calculator-8fd20fd5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_txhD2FO4JQcKea3JfJcRd

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability heart-score-calculator-8fd20fd5
```

Example prompt: Calculate the HEART score for a 67-year-old patient presenting with chest pain: history is highly suspicious (2), ECG shows significant ST depression (2), 3 cardiac risk factors (2), and troponin is 1.5 times the upper limit of normal (1).

## When to prefer this

Choose this endpoint when you need a fast, deterministic, citation-backed HEART score computation from pre-assigned component values and do not need ECG interpretation, history parsing, or clinical judgment — the caller must supply all five scored inputs. Prefer this over manual lookup tables when automating documentation or risk-band classification in an ED workflow agent.

## Known failure modes

- Missing required parameter (age, history, ecg, risk_factors, troponin) returns a validation error
- Non-integer or out-of-range values (e.g. ecg=3, age=15) return an error
- Caller misassigns component scores (e.g. ECG interpretation) — the API scores only what is passed; garbage-in, garbage-out
- Network or payment (x402) failure returns non-200 response

## How this service works

HEART score for emergency chest pain from age and caller-assigned history, ECG, risk factors, and troponin (each 0-2, max 10). Bands 0-3, 4-6, and 7-10 from Six 2008. Deterministic published score with citation; not a diagnosis or discharge protocol. magent does not read an ECG.

## Output

Returns a HEART total score (integer 0-10), the corresponding risk band label (low: 0-3, moderate: 4-6, high: 7-10), and the Six 2008 citation. The score is deterministic and reproducible given the same five inputs. No diagnosis or discharge recommendation is provided.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "age",
      "history",
      "ecg",
      "risk_factors",
      "troponin"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Younger than 45 scores 0; 45-64 scores 1; 65 or older scores 2."
      },
      "ecg": {
       "type": "integer",
       "description": "Caller-assigned ECG. 0 normal; 1 repolarization without significant ST depression (including BBB, LVH, digoxin, or known unchanged); 2 significant ST depression or elevation without those confounders. magent does not read an ECG."
      },
      "history": {
       "type": "integer",
       "description": "Caller-assigned history. 0 nonspecific, 1 moderately suspicious, 2 highly suspicious. magent does not interpret the history."
      },
      "troponin": {
       "type": "integer",
       "description": "Caller-assigned troponin. 0 ≤ULN, 1 = 1-2× ULN, 2 = >2× ULN (Six 2008). magent does not interpret assays."
      },
      "risk_factors": {
       "type": "integer",
       "description": "Caller-assigned risk-factor points. 0 none, 1 = 1-2 risk factors, 2 = ≥3 or atherosclerotic disease. magent does not count diabetes, smoking, or other factors."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/heart",
  "count": 2,
  "items": [
   {
    "score": 0,
    "formula": "heart",
    "citation": {
     "id": "six-2008",
     "doi": "10.1007/BF03086144",
     "title": "Chest pain in the emergency room: value of the HEART score",
     "source": "Neth Heart J. 2008;16(6):191-196",
     "authors": "Six AJ, Backus BE, Kelder JC"
    },
    "age_years": 40,
    "max_score": 10,
    "components": [
     {
      "value": 0,
      "factor": "history",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "ecg",
      "points": 0,
      "present": false
     },
     {
      "value": 40,
      "factor": "age",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "risk_factors",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "troponin",
      "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.",
    "heart_band": "0-3",
    "formula_expression": "HEART = history + ECG + age + risk_factors + troponin; each 0-2; age <45 0, 45-64 1, >=65 2; bands 0-3 / 4-6 / 7-10; max 10"
   },
   {
    "score": 0,
    "formula": "heart",
    "citation": {
     "id": "six-2008",
     "doi": "10.1007/BF03086144",
     "title": "Chest pain in the emergency room: value of the HEART score",
     "source": "Neth Heart J. 2008;16(6):191-196",
     "authors": "Six AJ, Backus BE, Kelder JC"
    },
    "age_years": 40,
    "max_score": 10,
    "components": [
     {
      "value": 0,
      "factor": "history",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "ecg",
      "points": 0,
      "present": false
     },
     {
      "value": 40,
      "factor": "age",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "risk_factors",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "troponin",
      "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.",
    "heart_band": "0-3",
    "formula_expression": "HEART = 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/heart-score-calculator-8fd20fd5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
