# T-MACS ACS probability

T-MACS

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/t_macs`
HTML: https://magentlab.com/docs/t-macs
Markdown: https://magentlab.com/docs/t-macs.md

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

## What it computes

Compute the Body 2016 Troponin-only Manchester Acute Coronary Syndromes (T-MACS) logistic probability of ACS from caller-assigned ECG ischaemia, worsening angina, right-arm or shoulder radiation, vomiting, observed sweating, hypotension, and Roche Elecsys hs-cTnT in ng/L.

## When to use

When an agent already has those Body 2016 predictors as assigned by the caller and needs the published T-MACS probability and risk band. magent does not interpret an ECG or assay troponin. Not a diagnosis, discharge protocol, or original MACS (H-FABP).

## When not to use

- Not a medical device. Not a diagnosis of ACS.
- ecg_ischaemia, worsening_angina, pain_radiation_right_arm_or_shoulder, vomiting, sweating_observed, and hypotension are caller-assigned. magent does not interpret ECG ischaemia or assay troponin.
- hs-cTnT is Roche Diagnostics Elecsys in ng/L as entered. 0–100000 ng/L is an implementation clamp. magent does not convert units.
- Body 2016 rounded T-MACS coefficients only. Not original MACS (H-FABP). Not HEART. Not EDACS. Not the Vancouver Chest Pain Rule.
- That paper writes low as 0.02<p<0.05 and moderate as 0.05<p<0.95 (equality at 0.02 and 0.05 omitted). magent uses a complete partition: p<0.02 very_low, 0.02≤p<0.05 low, 0.05≤p<0.95 moderate, p≥0.95 high. Bands use unrounded p.
- The paper notes patients are only ruled out if all model features are absent and hs-cTnT is <10 ng/L. This tool returns the logistic probability; it does not add a second checklist gate.
- Not a discharge, observation, or rule-out protocol.

## Formula

```
p = 1/(1+e^(-λ)); λ = 1.713*E + 0.847*A + 0.607*R + 1.417*V + 2.058*S + 1.208*H + 0.089*T - 4.766; E ECG ischaemia 0/1; A worsening/crescendo angina 0/1; R right-arm/shoulder radiation 0/1; V vomiting 0/1; S sweating observed 0/1; H hypotension SBP<100 0/1; T Roche Elecsys hs-cTnT ng/L; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2016 rounded coefficients; paper writes 0.02<p<0.05 and 0.05<p<0.95)
```

## Citation

[Troponin-only Manchester Acute Coronary Syndromes (T-MACS) decision aid: single biomarker re-derivation and external validation in three cohorts](https://doi.org/10.1136/emermed-2016-205983)
Body R, Carlton E, Sperrin M, et al.
Emerg Med J. 2017;34(6):349-356
DOI: [10.1136/emermed-2016-205983](https://doi.org/10.1136/emermed-2016-205983)

## Worked example

### All dichotomous false, hs-cTnT 3 ng/L

Given: `ecg_ischaemia=false, hs_ctnt_ng_l=3, hypotension=false, pain_radiation_right_arm_or_shoulder=false, sweating_observed=false, vomiting=false, worsening_angina=false`

1. E=A=R=V=S=H=0; T=3
2. λ = -4.766 + 0.089×3 = -4.499
3. p = 1/(1+e^4.499) = 0.0110
4. p<0.02 → very_low


## Also searched as

- T-MACS
- troponin-only MACS
- Troponin-only Manchester Acute Coronary Syndromes
- Body T-MACS
- Manchester ACS troponin
- T MACS decision aid
- hs-cTnT MACS

## Parameters

- `ecg_ischaemia` (boolean, required): Caller-assigned ECG ischaemia as used in Body 2016 (E; 1 if true, 0 if false). magent does not interpret an ECG.
- `worsening_angina` (boolean, required): Worsening or crescendo angina as assigned by the caller (A): anginal pain with increasing frequency, occurring with less exertion, or becoming more prolonged (Body 2016). true or false.
- `pain_radiation_right_arm_or_shoulder` (boolean, required): Pain radiating to the right arm or shoulder as assigned by the caller (R; Body 2016). true or false. magent does not take a pain history.
- `vomiting` (boolean, required): Vomiting in association with the presenting symptoms as assigned by the caller (V; Body 2016). true or false.
- `sweating_observed` (boolean, required): Sweating observed by the treating clinician as assigned by the caller (S; Body 2016). true or false. magent does not examine the patient.
- `hypotension` (boolean, required): Hypotension as assigned by the caller (H): systolic BP <100 mm Hg on arrival (Body 2016, dichotomised as in that paper). true or false.
- `hs_ctnt_ng_l` (number, required): Roche Diagnostics Elecsys high-sensitivity cardiac troponin T on arrival in ng/L (T; 0-100000, implementation clamp). Continuous linear predictor in Body 2016. magent does not convert units or assay troponin.

## 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.

Method: `POST /api/calc/t_macs`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 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:

```json
{
  "items": [
    {
      "ecg_ischaemia": "false",
      "hs_ctnt_ng_l": "3",
      "hypotension": "false",
      "pain_radiation_right_arm_or_shoulder": "false",
      "sweating_observed": "false",
      "vomiting": "false",
      "worsening_angina": "false"
    },
    {
      "ecg_ischaemia": "false",
      "hs_ctnt_ng_l": "3",
      "hypotension": "false",
      "pain_radiation_right_arm_or_shoulder": "false",
      "sweating_observed": "false",
      "vomiting": "false",
      "worsening_angina": "false"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/t-macs

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/t_macs",
  "items": [
    {
      "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": "Body R, Carlton E, Sperrin M, et al.",
        "doi": "10.1136/emermed-2016-205983",
        "id": "body-2016",
        "pmid": "27565197",
        "source": "Emerg Med J. 2017;34(6):349-356",
        "title": "Troponin-only Manchester Acute Coronary Syndromes (T-MACS) decision aid: single biomarker re-derivation and external validation in three cohorts"
      },
      "formula": "t_macs",
      "formula_expression": "p = 1/(1+e^(-λ)); λ = 1.713*E + 0.847*A + 0.607*R + 1.417*V + 2.058*S + 1.208*H + 0.089*T - 4.766; E ECG ischaemia 0/1; A worsening/crescendo angina 0/1; R right-arm/shoulder radiation 0/1; V vomiting 0/1; S sweating observed 0/1; H hypotension SBP<100 0/1; T Roche Elecsys hs-cTnT ng/L; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2016 rounded coefficients; paper writes 0.02<p<0.05 and 0.05<p<0.95)",
      "vomiting": false,
      "hypotension": false,
      "linear_predictor": -4.499,
      "probability": 0.011,
      "ecg_ischaemia": false,
      "hs_ctnt_ng_l": 3.0,
      "pain_radiation_right_arm_or_shoulder": false,
      "sweating_observed": false,
      "t_macs_band": "very_low",
      "worsening_angina": 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": "Body R, Carlton E, Sperrin M, et al.",
        "doi": "10.1136/emermed-2016-205983",
        "id": "body-2016",
        "pmid": "27565197",
        "source": "Emerg Med J. 2017;34(6):349-356",
        "title": "Troponin-only Manchester Acute Coronary Syndromes (T-MACS) decision aid: single biomarker re-derivation and external validation in three cohorts"
      },
      "formula": "t_macs",
      "formula_expression": "p = 1/(1+e^(-λ)); λ = 1.713*E + 0.847*A + 0.607*R + 1.417*V + 2.058*S + 1.208*H + 0.089*T - 4.766; E ECG ischaemia 0/1; A worsening/crescendo angina 0/1; R right-arm/shoulder radiation 0/1; V vomiting 0/1; S sweating observed 0/1; H hypotension SBP<100 0/1; T Roche Elecsys hs-cTnT ng/L; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2016 rounded coefficients; paper writes 0.02<p<0.05 and 0.05<p<0.95)",
      "vomiting": false,
      "hypotension": false,
      "linear_predictor": -4.499,
      "probability": 0.011,
      "ecg_ischaemia": false,
      "hs_ctnt_ng_l": 3.0,
      "pain_radiation_right_arm_or_shoulder": false,
      "sweating_observed": false,
      "t_macs_band": "very_low",
      "worsening_angina": false
    }
  ]
}
```

## Response fields

- `formula` (string): t_macs
- `formula_expression` (string): Body 2016 rounded T-MACS logistic expression
- `ecg_ischaemia` (boolean): Caller-assigned ECG ischaemia used as E
- `worsening_angina` (boolean): Caller-assigned worsening/crescendo angina used as A
- `pain_radiation_right_arm_or_shoulder` (boolean): Caller-assigned right-arm or shoulder radiation used as R
- `vomiting` (boolean): Caller-assigned vomiting used as V
- `sweating_observed` (boolean): Caller-assigned observed sweating used as S
- `hypotension` (boolean): Caller-assigned hypotension (SBP <100 mm Hg) used as H
- `hs_ctnt_ng_l` (number): Roche Elecsys hs-cTnT used as T, in ng/L
- `linear_predictor` (number): Body 2016 λ from the rounded coefficients, 4 decimals
- `probability` (number): p = 1/(1+e^(-λ)) on 0-1, 4 decimals. Banded on unrounded p.
- `t_macs_band` (string): very_low (p<0.02, ACS ruled out in that paper), low (0.02≤p<0.05), moderate (0.05≤p<0.95), or high (p≥0.95, ACS ruled in). Not a diagnosis.
- `citation` (object): Body 2016/2017 EMJ citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Body R, Carlton E, Sperrin M, et al.",
    "doi": "10.1136/emermed-2016-205983",
    "id": "body-2016",
    "pmid": "27565197",
    "source": "Emerg Med J. 2017;34(6):349-356",
    "title": "Troponin-only Manchester Acute Coronary Syndromes (T-MACS) decision aid: single biomarker re-derivation and external validation in three cohorts"
  },
  "formula": "t_macs",
  "formula_expression": "p = 1/(1+e^(-λ)); λ = 1.713*E + 0.847*A + 0.607*R + 1.417*V + 2.058*S + 1.208*H + 0.089*T - 4.766; E ECG ischaemia 0/1; A worsening/crescendo angina 0/1; R right-arm/shoulder radiation 0/1; V vomiting 0/1; S sweating observed 0/1; H hypotension SBP<100 0/1; T Roche Elecsys hs-cTnT ng/L; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2016 rounded coefficients; paper writes 0.02<p<0.05 and 0.05<p<0.95)",
  "vomiting": false,
  "hypotension": false,
  "linear_predictor": -4.499,
  "probability": 0.011,
  "ecg_ischaemia": false,
  "hs_ctnt_ng_l": 3.0,
  "pain_radiation_right_arm_or_shoulder": false,
  "sweating_observed": false,
  "t_macs_band": "very_low",
  "worsening_angina": false
}
```

## Errors

- HTTP 400 `invalid_t_macs`: T-MACS inputs must match Body 2016 dichotomous predictors and Roche hs-cTnT ng/L from that paper. Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [HEART score](https://magentlab.com/docs/heart) — Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).
- [EDACS](https://magentlab.com/docs/edacs) — Compute the Than 2014 Emergency Department Assessment of Chest pain Score from age, sex, and caller-assigned flags.
- [Vancouver Chest Pain Rule](https://magentlab.com/docs/vancouver-chest-pain) — Apply the Christenson 2006 Vancouver Chest Pain Rule derivation tree and return whether caller-assigned ECG, 2-hour troponin, prior ACS or nitrate, palpation, age, and radiation nodes are early-discharge eligible.

## 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.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
