LIVE
MELD-Na
Compute OPTN/UNOS 2016 MELD and MELD-Na from creatinine, bilirubin, INR, sodium, and dialysis.
Markdown: /docs/meld-na.md · Canonical: https://magentlab.com/docs/meld-na
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute OPTN/UNOS 2016 MELD and MELD-Na from creatinine, bilirubin, INR, sodium, and dialysis.
When to use
When an agent needs the published MELD-Na arithmetic and must not invent the integer score.
When not to use
- Not a listing recommendation or allocation decision.
- Applies OPTN creatinine/bilirubin/INR floors and sodium clamp (125–137). Dialysis forces creatinine 4.0.
- Does not compute exception scores or MELD 3.0.
Formula
MELD = round(10 * (0.957*ln(Cr) + 0.378*ln(bili) + 1.120*ln(INR) + 0.643)); if MELD > 11, MELD-Na = round(MELD + 1.32*(137-Na) - 0.033*MELD*(137-Na))
Citation
- Title
- Serum sodium predicts mortality in patients listed for liver transplantation; OPTN Policy 9 MELD-Na bounds
- Authors
- Biggins SW, Kim WR, Terrault NA, et al.; OPTN/UNOS
- Source
- Gastroenterology. 2006;130(6):1652-1660; OPTN Policy 9 (2016)
Worked example
Cr 1.9, bili 4.2, INR 1.2, Na 128
Given:
bilirubin_mg_dl=4.2creatinine_mg_dl=1.9dialysis=falseinr=1.2sodium_mmol_l=128
- Clamp labs per OPTN Policy 9 (Na used = 128).
- MELD = round(10 * (0.957*ln(Cr) + 0.378*ln(bili) + 1.120*ln(INR) + 0.643))
- If MELD > 11, apply the sodium term → MELD-Na
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/meld_na?creatinine_mg_dl=1.9&bilirubin_mg_dl=4.2&inr=1.2&sodium_mmol_l=128&dialysis=false
Full URL: https://api.magentlab.com/api/calc/meld_na?creatinine_mg_dl=1.9&bilirubin_mg_dl=4.2&inr=1.2&sodium_mmol_l=128&dialysis=false
x402 V2 curl
Expect HTTP 402 and a PAYMENT-REQUIRED
header 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/meld_na?creatinine_mg_dl=1.9&bilirubin_mg_dl=4.2&inr=1.2&sodium_mmol_l=128&dialysis=false"
Cursor mcp.json
Intended config for @magent/mcp. This is not npm @x402/fetch
(a payment fetch wrapper).
{
"mcpServers": {
"magent": {
"args": [
"-y",
"@magent/mcp"
],
"command": "npx",
"env": {
"X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
}
}
}
}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
creatinine_mg_dl |
number | optional | Serum creatinine in mg/dL. Provide this or creatinine_umol_l. OPTN floors at 1 and caps at 4. |
creatinine_umol_l |
number | optional | Serum creatinine in µmol/L. |
bilirubin_mg_dl |
number | optional | Total bilirubin in mg/dL (0.1-40). Provide this or bilirubin_umol_l. OPTN floors at 1. |
bilirubin_umol_l |
number | optional | Total bilirubin in µmol/L. Converted as mg/dL = µmol/L / 17.1. |
inr |
number | required | INR (0.8-10). OPTN floors at 1. |
sodium_mmol_l |
number | required | Serum sodium in mmol/L (110-160). OPTN clamps 125-137. Applied only when MELD > 11. |
dialysis |
boolean | required | Dialysis twice in the last week. true sets creatinine used to 4.0. |
Response
| Field | Type | Description |
|---|---|---|
formula |
string | optn_meld_na_2016 |
formula_expression |
string | Exact expressions used |
creatinine_mg_dl |
number | Input creatinine in mg/dL |
bilirubin_mg_dl |
number | Input bilirubin in mg/dL |
inr |
number | Input INR |
sodium_mmol_l |
number | Input sodium |
dialysis |
boolean | Dialysis flag |
creatinine_used_mg_dl |
number | Creatinine after OPTN bounds |
bilirubin_used_mg_dl |
number | Bilirubin after OPTN floor |
inr_used |
number | INR after OPTN floor |
sodium_used_mmol_l |
number | Sodium after OPTN clamp |
meld |
integer | MELD without sodium, nearest integer |
meld_na |
integer | MELD-Na, nearest integer |
citation |
object | Biggins 2006 + OPTN Policy 9 |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Biggins SW, Kim WR, Terrault NA, et al.; OPTN/UNOS",
"doi": "10.1053/j.gastro.2006.02.010",
"id": "optn-meld-na-2016",
"source": "Gastroenterology. 2006;130(6):1652-1660; OPTN Policy 9 (2016)",
"title": "Serum sodium predicts mortality in patients listed for liver transplantation; OPTN Policy 9 MELD-Na bounds"
},
"formula": "optn_meld_na_2016",
"formula_expression": "MELD = round(10 * (0.957*ln(Cr) + 0.378*ln(bili) + 1.120*ln(INR) + 0.643)); if MELD > 11, MELD-Na = round(MELD + 1.32*(137-Na) - 0.033*MELD*(137-Na))",
"creatinine_mg_dl": 1.9,
"bilirubin_mg_dl": 4.2,
"bilirubin_used_mg_dl": 4.2,
"creatinine_used_mg_dl": 1.9,
"dialysis": false,
"inr": 1.2,
"inr_used": 1.2,
"meld": 20,
"meld_na": 26,
"sodium_mmol_l": 128.0,
"sodium_used_mmol_l": 128.0
}
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_creatinine |
creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required Returned before settlement; you are not charged. |
| 400 | invalid_bilirubin |
bilirubin_mg_dl (0.1-40) or bilirubin_umol_l (2-684) is required Returned before settlement; you are not charged. |
| 400 | invalid_inr |
inr must be a number from 0.8 to 10 Returned before settlement; you are not charged. |
| 400 | invalid_sodium |
sodium_mmol_l must be a number from 110 to 160 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. |
| 402 | payment_required |
Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header |
| 409 | payment_in_progress |
The same authorization nonce is already being settled; retry shortly |
| 429 | rate_limited |
Too many requests from this client |
| 503 | settlement_uncertain |
Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE |
| 503 | facilitator_unavailable |
Payment facilitator unavailable |
| 503 | facilitator_misconfigured |
Payment facilitator is not configured |
| 503 | facilitator_unauthorized |
Payment facilitator rejected credentials |
| 503 | ledger_unavailable |
Payment ledger unavailable |
| 503 | payment_unavailable |
Payment processing unavailable |
Related tools
- FIB-4 — Compute the FIB-4 fibrosis index from age, AST, ALT, and platelets.
Also searched as
- MELD-Na
- OPTN MELD-Na
- sodium-adjusted MELD
- UNOS MELD 2016
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. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the
tool runs. Full handshake and shared payment errors: Payments.
Guarantees
- Invalid query parameters return HTTP 400 before settlement. You are not charged.
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are not persisted. Request logs store path without query.