# McMahon rhabdomyolysis score

McMahon score

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

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

## What it computes

Sum McMahon 2013 Table 3 derivation points from age, sex, initial creatinine, calcium, CPK, etiology, phosphate, and bicarbonate and return the numeric total (max 19).

## When to use

When an agent needs the published McMahon rhabdomyolysis point total and must not invent a dialysis order, diagnosis, or named risk class.

## When not to use

- Not a medical device and not a diagnosis or dialysis order. magent does not assay labs.
- Adults with rhabdomyolysis as in McMahon 2013. Age is an integer 18-120. Labs and origin are caller-supplied.
- Half-points follow Table 3 derivation. Theoretical max is 19 (sum of published maxima); the paper observed 0–17.5.
- Derivation stratified the composite of kidney failure or death at score <5 versus >10. magent returns the numeric total only and does not emit named risk classes.

## Formula

```
McMahon = age(≤50→0, >50–≤70→1.5, >70–≤80→2.5, >80→3) + female(1) + Cr_mg_dL(<1.4→0, 1.4–2.2→1.5, >2.2→3) + Ca_mg_dL(<7.5→2) + CPK_U_L(>40000→2) + origin_not_seizure_syncope_exercise_statin_myositis(3) + PO4_mg_dL(<4.0→0, 4.0–5.4→1.5, >5.4→3) + HCO3_mEq_L(<19→2); McMahon 2013 Table 3 derivation; max 19
```

## Citation

[A risk prediction score for kidney failure or mortality in rhabdomyolysis](https://doi.org/10.1001/jamainternmed.2013.9774)
McMahon GM, Zeng X, Waikar SS
JAMA Intern Med. 2013;173(19):1821-1828
DOI: [10.1001/jamainternmed.2013.9774](https://doi.org/10.1001/jamainternmed.2013.9774)

## Worked example

### All zero-point bands

Given: `age=40, bicarbonate_mmol_l=24, calcium_mg_dl=9.0, cpk_u_l=2000, creatinine_mg_dl=1.0, low_risk_origin=true, phosphate_mg_dl=3.5, sex=male`

1. Age 40 → 0; male → 0; Cr 1.0 → 0; Ca 9.0 → 0; CPK 2000 → 0; low-risk origin → 0; phosphate 3.5 → 0; bicarbonate 24 → 0
2. Score = 0 (max 19). Numeric total only; no named risk class.


### Age 51 isolated on the zero baseline

Given: `age=51, bicarbonate_mmol_l=24, calcium_mg_dl=9.0, cpk_u_l=2000, creatinine_mg_dl=1.0, low_risk_origin=true, phosphate_mg_dl=3.5, sex=male`

1. Age 51 is >50 to ≤70 → 1.5; remaining factors 0
2. Score = 1.5 (max 19).


## Also searched as

- McMahon score
- McMahon rhabdomyolysis
- rhabdomyolysis kidney failure score
- McMahon 2013
- rhabdomyolysis mortality score
- McMahon prediction score
- rhabdo score
- kidney failure rhabdomyolysis

## Parameters

- `age` (integer, required): Age in years (integer 18-120). McMahon 2013 Table 3: ≤50 → 0, >50 to ≤70 → 1.5, >70 to ≤80 → 2.5, >80 → 3. magent does not assign age.
- `sex` (string, required): Caller-assigned sex. Female scores 1 (McMahon 2013 Table 3). magent does not assign sex.
- `creatinine_mg_dl` (number, optional): Initial serum creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l. McMahon 2013 Table 3: <1.4 → 0, 1.4 to 2.2 inclusive → 1.5, >2.2 → 3. magent does not assay creatinine.
- `creatinine_umol_l` (number, optional): Initial serum creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42. magent does not assay creatinine.
- `calcium_mg_dl` (number, required): Initial calcium in mg/dL (4-16). McMahon 2013 Table 3: <7.5 → 2. 7.5 is not <7.5. magent does not assay calcium.
- `cpk_u_l` (number, required): Initial CPK in U/L (1-500000). McMahon 2013 Table 3: >40000 → 2. 40000 is not >40000. magent does not assay CPK.
- `low_risk_origin` (boolean, required): true when the cause is seizure, syncope, exercise, statin, or myositis (0 points). false otherwise (3 points; McMahon 2013 Table 3 origin not those causes). magent does not assign etiology.
- `phosphate_mg_dl` (number, required): Initial phosphate in mg/dL (0.5-20). McMahon 2013 Table 3: <4.0 → 0, 4.0 to 5.4 inclusive → 1.5, >5.4 → 3. magent does not assay phosphate.
- `bicarbonate_mmol_l` (number, required): Initial bicarbonate in mEq/L or mmol/L (2-45). McMahon 2013 Table 3: <19 → 2. 19 is not <19. magent does not assay bicarbonate.

## 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/mcmahon`
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": [
    {
      "age": "40",
      "bicarbonate_mmol_l": "24",
      "calcium_mg_dl": "9.0",
      "cpk_u_l": "2000",
      "creatinine_mg_dl": "1.0",
      "low_risk_origin": "true",
      "phosphate_mg_dl": "3.5",
      "sex": "male"
    },
    {
      "age": "40",
      "bicarbonate_mmol_l": "24",
      "calcium_mg_dl": "9.0",
      "cpk_u_l": "2000",
      "creatinine_mg_dl": "1.0",
      "low_risk_origin": "true",
      "phosphate_mg_dl": "3.5",
      "sex": "male"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/mcmahon",
  "items": [
    {
      "components": [
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "value": "male",
          "factor": "female",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine",
          "points": 0,
          "present": false
        },
        {
          "value": 9.0,
          "factor": "calcium",
          "points": 0,
          "present": false
        },
        {
          "value": 2.0e3,
          "factor": "cpk",
          "points": 0,
          "present": false
        },
        {
          "value": true,
          "factor": "origin",
          "points": 0,
          "present": false
        },
        {
          "value": 3.5,
          "factor": "phosphate",
          "points": 0,
          "present": false
        },
        {
          "value": 24.0,
          "factor": "bicarbonate",
          "points": 0,
          "present": false
        }
      ],
      "age": 40,
      "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": "McMahon GM, Zeng X, Waikar SS",
        "doi": "10.1001/jamainternmed.2013.9774",
        "id": "mcmahon-2013",
        "pmid": "23939467",
        "source": "JAMA Intern Med. 2013;173(19):1821-1828",
        "title": "A risk prediction score for kidney failure or mortality in rhabdomyolysis"
      },
      "formula": "mcmahon",
      "formula_expression": "McMahon = age(≤50→0, >50–≤70→1.5, >70–≤80→2.5, >80→3) + female(1) + Cr_mg_dL(<1.4→0, 1.4–2.2→1.5, >2.2→3) + Ca_mg_dL(<7.5→2) + CPK_U_L(>40000→2) + origin_not_seizure_syncope_exercise_statin_myositis(3) + PO4_mg_dL(<4.0→0, 4.0–5.4→1.5, >5.4→3) + HCO3_mEq_L(<19→2); McMahon 2013 Table 3 derivation; max 19",
      "max_score": 19,
      "score": 0,
      "creatinine_mg_dl": 1.0,
      "sex": "male",
      "bicarbonate_mmol_l": 24.0,
      "calcium_mg_dl": 9.0,
      "cpk_u_l": 2.0e3,
      "low_risk_origin": true,
      "phosphate_mg_dl": 3.5
    },
    {
      "components": [
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "value": "male",
          "factor": "female",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine",
          "points": 0,
          "present": false
        },
        {
          "value": 9.0,
          "factor": "calcium",
          "points": 0,
          "present": false
        },
        {
          "value": 2.0e3,
          "factor": "cpk",
          "points": 0,
          "present": false
        },
        {
          "value": true,
          "factor": "origin",
          "points": 0,
          "present": false
        },
        {
          "value": 3.5,
          "factor": "phosphate",
          "points": 0,
          "present": false
        },
        {
          "value": 24.0,
          "factor": "bicarbonate",
          "points": 0,
          "present": false
        }
      ],
      "age": 40,
      "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": "McMahon GM, Zeng X, Waikar SS",
        "doi": "10.1001/jamainternmed.2013.9774",
        "id": "mcmahon-2013",
        "pmid": "23939467",
        "source": "JAMA Intern Med. 2013;173(19):1821-1828",
        "title": "A risk prediction score for kidney failure or mortality in rhabdomyolysis"
      },
      "formula": "mcmahon",
      "formula_expression": "McMahon = age(≤50→0, >50–≤70→1.5, >70–≤80→2.5, >80→3) + female(1) + Cr_mg_dL(<1.4→0, 1.4–2.2→1.5, >2.2→3) + Ca_mg_dL(<7.5→2) + CPK_U_L(>40000→2) + origin_not_seizure_syncope_exercise_statin_myositis(3) + PO4_mg_dL(<4.0→0, 4.0–5.4→1.5, >5.4→3) + HCO3_mEq_L(<19→2); McMahon 2013 Table 3 derivation; max 19",
      "max_score": 19,
      "score": 0,
      "creatinine_mg_dl": 1.0,
      "sex": "male",
      "bicarbonate_mmol_l": 24.0,
      "calcium_mg_dl": 9.0,
      "cpk_u_l": 2.0e3,
      "low_risk_origin": true,
      "phosphate_mg_dl": 3.5
    }
  ]
}
```

## Response fields

- `formula` (string): mcmahon
- `formula_expression` (string): Exact expression used
- `score` (number): McMahon 2013 Table 3 points (half-points allowed; 0-19)
- `max_score` (integer): Always 19 (sum of published maxima)
- `age` (integer): Age used, years
- `sex` (string): female or male
- `creatinine_mg_dl` (number): Initial creatinine used, mg/dL
- `calcium_mg_dl` (number): Initial calcium used, mg/dL
- `cpk_u_l` (number): Initial CPK used, U/L
- `low_risk_origin` (boolean): true when origin is seizure, syncope, exercise, statin, or myositis (0 origin points)
- `phosphate_mg_dl` (number): Initial phosphate used, mg/dL
- `bicarbonate_mmol_l` (number): Initial bicarbonate used, mEq/L
- `components` (array): Per-factor points
- `citation` (object): McMahon et al. JAMA Intern Med 2013 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 40,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "value": "male",
      "factor": "female",
      "points": 0,
      "present": false
    },
    {
      "value": 1.0,
      "factor": "creatinine",
      "points": 0,
      "present": false
    },
    {
      "value": 9.0,
      "factor": "calcium",
      "points": 0,
      "present": false
    },
    {
      "value": 2.0e3,
      "factor": "cpk",
      "points": 0,
      "present": false
    },
    {
      "value": true,
      "factor": "origin",
      "points": 0,
      "present": false
    },
    {
      "value": 3.5,
      "factor": "phosphate",
      "points": 0,
      "present": false
    },
    {
      "value": 24.0,
      "factor": "bicarbonate",
      "points": 0,
      "present": false
    }
  ],
  "age": 40,
  "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": "McMahon GM, Zeng X, Waikar SS",
    "doi": "10.1001/jamainternmed.2013.9774",
    "id": "mcmahon-2013",
    "pmid": "23939467",
    "source": "JAMA Intern Med. 2013;173(19):1821-1828",
    "title": "A risk prediction score for kidney failure or mortality in rhabdomyolysis"
  },
  "formula": "mcmahon",
  "formula_expression": "McMahon = age(≤50→0, >50–≤70→1.5, >70–≤80→2.5, >80→3) + female(1) + Cr_mg_dL(<1.4→0, 1.4–2.2→1.5, >2.2→3) + Ca_mg_dL(<7.5→2) + CPK_U_L(>40000→2) + origin_not_seizure_syncope_exercise_statin_myositis(3) + PO4_mg_dL(<4.0→0, 4.0–5.4→1.5, >5.4→3) + HCO3_mEq_L(<19→2); McMahon 2013 Table 3 derivation; max 19",
  "max_score": 19,
  "score": 0,
  "creatinine_mg_dl": 1.0,
  "sex": "male",
  "bicarbonate_mmol_l": 24.0,
  "calcium_mg_dl": 9.0,
  "cpk_u_l": 2.0e3,
  "low_risk_origin": true,
  "phosphate_mg_dl": 3.5
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_sex`: sex must be female or male Returned before settlement; you are not charged.
- HTTP 400 `invalid_creatinine`: creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_calcium`: calcium_mg_dl (4-16) or calcium_mmol_l (1-4) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_cpk`: cpk_u_l must be a number from 1 to 500000 (McMahon 2013). Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_phosphate`: phosphate_mg_dl must be a number from 0.5 to 20 (McMahon 2013). Returned before settlement; you are not charged.
- HTTP 400 `invalid_bicarbonate`: bicarbonate_mmol_l must be a number from 2 to 45. 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

- [Cockcroft–Gault CrCl](https://magentlab.com/docs/crcl) — Compute Cockcroft–Gault creatinine clearance in mL/min using total body weight.
- [FENa](https://magentlab.com/docs/fena) — Compute fractional excretion of sodium from plasma and urine sodium and creatinine using Espinel 1976.

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