MAGENT

WEDGE

FENa

Compute fractional excretion of sodium from plasma and urine sodium and creatinine using Espinel 1976.

WEDGE $0.005 USDC GET /api/calc/fena

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

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

What it computes

Compute fractional excretion of sodium from plasma and urine sodium and creatinine using Espinel 1976.

When to use

When an agent needs Espinel FENa arithmetic and must not invent a prerenal versus ATN cutoff.

When not to use

  • Not a diagnosis and not a treatment order. Espinel 1976 strata were described in oliguric acute renal failure; FENa <1 prerenal and FENa >3 ATN are paper cutoffs, not an AKI taxonomy.
  • Diuretics, CKD, and non-oliguric injury confound FENa. This tool does not adjust for those states.

Formula

FENa_percent = 100 * (urine_sodium_mmol_l * plasma_creatinine_mg_dl) / (plasma_sodium_mmol_l * urine_creatinine_mg_dl)

Citation

Title
The FENa test. Use in the differential diagnosis of acute renal failure
Authors
Espinel CH
Source
JAMA. 1976;236(6):579-581
DOI
10.1001/jama.1976.03270060029022

Worked example

UNa 20, PNa 140, UCr 100, PCr 2.0

Given: creatinine_mg_dl=2.0sodium_mmol_l=140urine_creatinine_mg_dl=100urine_sodium_mmol_l=20

  1. FENa = 100 * (20 * 2.0) / (140 * 100) = 0.2857…
  2. Round to 2 decimals → 0.29
  3. Espinel 1976 stratum <1 → prerenal

Try

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

/api/calc/fena?sodium_mmol_l=140&creatinine_mg_dl=2.0&urine_sodium_mmol_l=20&urine_creatinine_mg_dl=100

Full URL: https://api.magentlab.com/api/calc/fena?sodium_mmol_l=140&creatinine_mg_dl=2.0&urine_sodium_mmol_l=20&urine_creatinine_mg_dl=100

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. HTTP 503 after a signature: retry the same PAYMENT-SIGNATURE — that is not a new 402.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/fena?sodium_mmol_l=140&creatinine_mg_dl=2.0&urine_sodium_mmol_l=20&urine_creatinine_mg_dl=100"

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
sodium_mmol_l number required Plasma or serum sodium in mmol/L (110-160).
creatinine_mg_dl number optional Plasma creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l.
creatinine_umol_l number optional Plasma creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42.
urine_sodium_mmol_l number required Urine sodium in mmol/L (1-300).
urine_creatinine_mg_dl number optional Urine creatinine in mg/dL (1-500). Provide this or urine_creatinine_umol_l.
urine_creatinine_umol_l number optional Urine creatinine in µmol/L (88-44210). Converted as mg/dL = µmol/L / 88.42.

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/fena 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": [
    {
      "creatinine_mg_dl": "2.0",
      "sodium_mmol_l": "140",
      "urine_creatinine_mg_dl": "100",
      "urine_sodium_mmol_l": "20"
    },
    {
      "creatinine_mg_dl": "2.0",
      "sodium_mmol_l": "140",
      "urine_creatinine_mg_dl": "100",
      "urine_sodium_mmol_l": "20"
    }
  ]
}

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/fena",
  "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": "Espinel CH",
        "doi": "10.1001/jama.1976.03270060029022",
        "id": "espinel-1976",
        "source": "JAMA. 1976;236(6):579-581",
        "title": "The FENa test. Use in the differential diagnosis of acute renal failure"
      },
      "formula": "fena",
      "formula_expression": "FENa_percent = 100 * (urine_sodium_mmol_l * plasma_creatinine_mg_dl) / (plasma_sodium_mmol_l * urine_creatinine_mg_dl)",
      "sodium_mmol_l": 140.0,
      "creatinine_mg_dl": 2.0,
      "urine_creatinine_mg_dl": 100.0,
      "espinel_stratum": "prerenal",
      "fena_percent": 0.29,
      "urine_sodium_mmol_l": 20.0
    },
    {
      "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": "Espinel CH",
        "doi": "10.1001/jama.1976.03270060029022",
        "id": "espinel-1976",
        "source": "JAMA. 1976;236(6):579-581",
        "title": "The FENa test. Use in the differential diagnosis of acute renal failure"
      },
      "formula": "fena",
      "formula_expression": "FENa_percent = 100 * (urine_sodium_mmol_l * plasma_creatinine_mg_dl) / (plasma_sodium_mmol_l * urine_creatinine_mg_dl)",
      "sodium_mmol_l": 140.0,
      "creatinine_mg_dl": 2.0,
      "urine_creatinine_mg_dl": 100.0,
      "espinel_stratum": "prerenal",
      "fena_percent": 0.29,
      "urine_sodium_mmol_l": 20.0
    }
  ]
}

Response

Field Type Description
formula string fena
formula_expression string Exact expression used
sodium_mmol_l number Plasma sodium in mmol/L
creatinine_mg_dl number Normalized plasma creatinine
urine_sodium_mmol_l number Urine sodium in mmol/L
urine_creatinine_mg_dl number Normalized urine creatinine in mg/dL
fena_percent number FENa in percent, 2 decimal places
espinel_stratum string Espinel 1976 oliguric ARF strata: prerenal (FENa <1), indeterminate (1-3), atn (FENa >3). Not a diagnosis.
citation object JAMA 1976 citation
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 published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Espinel CH",
    "doi": "10.1001/jama.1976.03270060029022",
    "id": "espinel-1976",
    "source": "JAMA. 1976;236(6):579-581",
    "title": "The FENa test. Use in the differential diagnosis of acute renal failure"
  },
  "formula": "fena",
  "formula_expression": "FENa_percent = 100 * (urine_sodium_mmol_l * plasma_creatinine_mg_dl) / (plasma_sodium_mmol_l * urine_creatinine_mg_dl)",
  "sodium_mmol_l": 140.0,
  "creatinine_mg_dl": 2.0,
  "urine_creatinine_mg_dl": 100.0,
  "espinel_stratum": "prerenal",
  "fena_percent": 0.29,
  "urine_sodium_mmol_l": 20.0
}

Errors

HTTP Code When
400 invalid_sodium sodium_mmol_l must be a number from 110 to 160 Returned before settlement; you are not charged.
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_urine_sodium urine_sodium_mmol_l must be a number from 1 to 300. Returned before settlement; you are not charged.
400 invalid_urine_creatinine urine_creatinine_mg_dl (1-500) or urine_creatinine_umol_l (88-44210) is required. 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.
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 settle_failed Settlement failed; retry with the same PAYMENT-SIGNATURE shortly
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

  • Cockcroft–Gault CrCl — Compute Cockcroft–Gault creatinine clearance in mL/min using total body weight.
  • CKD-EPI 2021 eGFR — Compute race-free CKD-EPI 2021 creatinine eGFR in mL/min/1.73m2.
  • FEUrea — Compute fractional excretion of urea (FEUN) from BUN, urine urea nitrogen, plasma creatinine, and urine creatinine.

Also searched as

  • fractional excretion of sodium
  • FENa
  • Espinel FENa test
  • urine sodium fraction
  • prerenal versus ATN

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.

Guarantees

  • Invalid query parameters return HTTP 400 before settlement. You are not charged.
  • Settlement finishes before the tool executes. 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 not persisted. Request logs store path without query.