MAGENT

LIVE

HEART score

Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).

Also searched as

  • HEART score
  • HEART chest pain score
  • History ECG Age Risk Troponin
  • Six HEART score
  • emergency room HEART score
  • chest pain HEART
  • HEART score Six 2008

LIVE $0.005 USDC GET /api/calc/heart

Markdown: /docs/heart.md · Canonical: https://magentlab.com/docs/heart

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).

When to use

When an agent needs the published Six 2008 HEART total and must not invent history, ECG, risk-factor, or troponin points from a tracing or assay.

When not to use

  • Not a diagnosis or discharge protocol.
  • history, ecg, risk_factors, and troponin are caller-assigned integers 0-2. magent does not interpret the history, count risk factors, or read an ECG.
  • This is the HEART score (Six 2008), not HEART Pathway. Troponin uses Six 2008 bands (≤ULN / 1-2× ULN / >2× ULN).

Formula

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

Citation

Title
Chest pain in the emergency room: value of the HEART score
Authors
Six AJ, Backus BE, Kelder JC
Source
Neth Heart J. 2008;16(6):191-196
DOI
10.1007/BF03086144

Worked example

Age 40, all components 0

Given: age=40ecg=0history=0risk_factors=0troponin=0

  1. Age 40 (<45) → 0; history 0; ECG 0; risk_factors 0; troponin 0
  2. Score = 0; band 0-3

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/heart?age=40&history=0&ecg=0&risk_factors=0&troponin=0

Full URL: https://api.magentlab.com/api/calc/heart?age=40&history=0&ecg=0&risk_factors=0&troponin=0

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/heart?age=40&history=0&ecg=0&risk_factors=0&troponin=0"

Parameters

Name Type Required Description
age integer required Age in years (18-120). Younger than 45 scores 0; 45-64 scores 1; 65 or older scores 2.
history integer required Caller-assigned history. 0 nonspecific, 1 moderately suspicious, 2 highly suspicious. magent does not interpret the history.
ecg integer required 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.
risk_factors integer required 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.
troponin integer required Caller-assigned troponin. 0 ≤ULN, 1 = 1-2× ULN, 2 = >2× ULN (Six 2008). magent does not interpret assays.

Bulk (POST)

POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.

POST /api/calc/heart Max 25 unit_amount * n PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • 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": "40",
      "ecg": "0",
      "history": "0",
      "risk_factors": "0",
      "troponin": "0"
    },
    {
      "age": "40",
      "ecg": "0",
      "history": "0",
      "risk_factors": "0",
      "troponin": "0"
    }
  ]
}

Open bulk paywall →

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/heart",
  "items": [
    {
      "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.",
      "citation": {
        "authors": "Six AJ, Backus BE, Kelder JC",
        "doi": "10.1007/BF03086144",
        "id": "six-2008",
        "source": "Neth Heart J. 2008;16(6):191-196",
        "title": "Chest pain in the emergency room: value of the HEART score"
      },
      "formula": "heart",
      "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",
      "max_score": 10,
      "score": 0,
      "age_years": 40,
      "heart_band": "0-3"
    },
    {
      "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.",
      "citation": {
        "authors": "Six AJ, Backus BE, Kelder JC",
        "doi": "10.1007/BF03086144",
        "id": "six-2008",
        "source": "Neth Heart J. 2008;16(6):191-196",
        "title": "Chest pain in the emergency room: value of the HEART score"
      },
      "formula": "heart",
      "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",
      "max_score": 10,
      "score": 0,
      "age_years": 40,
      "heart_band": "0-3"
    }
  ]
}

Response

Field Type Description
formula string heart
formula_expression string Exact expression used
score integer Total points 0-10
max_score integer Always 10
heart_band string 0-3, 4-6, or 7-10 (Six 2008)
age_years integer Age used for the <45 / 45-64 / ≥65 bands
components array Per-factor 0-2 points
citation object Six 2008 citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "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.",
  "citation": {
    "authors": "Six AJ, Backus BE, Kelder JC",
    "doi": "10.1007/BF03086144",
    "id": "six-2008",
    "source": "Neth Heart J. 2008;16(6):191-196",
    "title": "Chest pain in the emergency room: value of the HEART score"
  },
  "formula": "heart",
  "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",
  "max_score": 10,
  "score": 0,
  "age_years": 40,
  "heart_band": "0-3"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_heart_component history, ecg, risk_factors, and troponin must each be 0, 1, or 2. 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.

Payment

Required query parameters must be present and valid. 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

  • Invalid query parameters return HTTP 400 before settlement. You are not charged.
  • Settlement finishes before the tool executes (paymentFlow upfront). 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.