# LENT score (malignant pleural effusion)

LENT

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

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

## What it computes

Sum the Clive 2014 Table 3 LENT score (pleural fluid LDH, ECOG, serum NLR, tumour type) and return low (0-1), moderate (2-4), or high (5-7).

## When to use

When an agent already has pleural fluid LDH, a caller-assigned ECOG 0-4, a serum NLR number, and a Clive tumour token, and must not invent a diagnosis, treatment order, or survival assignment. magent does not observe the patient or compute NLR from percents.

## When not to use

- Not a medical device and not a diagnosis or treatment order. magent does not observe the patient.
- Clive 2014 Table 3 writes <1500 vs >1500 and <9 vs >9 with no equals. LDH 1500 and NLR 9 are not scored.
- Median survivals 319 / 130 / 44 days are Clive 2014 paper numbers only, not a prognosis assignment.
- Oken 1982 ECOG 0-4 only. Grade 5 (dead) is not scored. The caller assigns ecog; magent does not convert Karnofsky.
- nlr is a number. magent does not compute NLR from neutrophil or lymphocyte percents.

## Formula

```
LENT = L (pleural LDH IU/L: <1500 → 0, >1500 → 1) + E (ECOG 0→0, 1→1, 2→2, 3-4→3) + N (serum NLR: <9 → 0, >9 → 1) + T (mesothelioma/haematological → 0; breast/gynaecological/renal_cell → 1; lung/other → 2); Clive 2014 Table 3; max 7; 0-1 low, 2-4 moderate, 5-7 high
```

## Citation

[Predicting survival in malignant pleural effusion: development and validation of the LENT prognostic score](https://doi.org/10.1136/thoraxjnl-2014-205285)
Clive AO, Kahan BC, Hooper CE, Bhatnagar R, Morley AJ, Zahan-Evans N, Bintcliffe OJ, Boshuizen RC, Fysh ETH, Tobin CL, Medford ARL, Harvey JE, van den Heuvel MM, Lee YCG, Maskell NA
Thorax. 2014;69(12):1098-1104
DOI: [10.1136/thoraxjnl-2014-205285](https://doi.org/10.1136/thoraxjnl-2014-205285)

## Worked example

### LDH 1000, ECOG 0, NLR 5, mesothelioma

Given: `ecog=0, nlr=5, pleural_ldh_u_l=1000, tumor_type=mesothelioma`

1. L: pleural LDH 1000 < 1500 → 0
2. E: ECOG 0 → 0
3. N: NLR 5 < 9 → 0
4. T: mesothelioma → 0
5. score = 0 (max 7); risk = low


### LDH 1000, ECOG 4, NLR 5, lung

Given: `ecog=4, nlr=5, pleural_ldh_u_l=1000, tumor_type=lung`

1. L: 1000 < 1500 → 0; E: ECOG 4 → 3; N: 5 < 9 → 0; T: lung → 2
2. score = 5 (max 7); risk = high


## Also searched as

- LENT score
- LENT prognostic score
- malignant pleural effusion score
- Clive LENT
- pleural LDH ECOG NLR
- MPE LENT
- LENT survival score

## Parameters

- `pleural_ldh_u_l` (number, required): Pleural fluid LDH in IU/L (1-20000, not 1500). Clive 2014 Table 3: <1500 scores 0, >1500 scores 1. Equality at 1500 is not scored.
- `ecog` (integer, required): Oken 1982 ECOG performance status 0-4 as assigned by the caller. Clive 2014: 0→0, 1→1, 2→2, 3-4→3. Grade 5 (dead) is not scored. magent does not observe the patient.
- `nlr` (number, required): Serum neutrophil-to-lymphocyte ratio as a number (0.05-200, not 9). Clive 2014 Table 3: <9 scores 0, >9 scores 1. Equality at 9 is not scored. Pass nlr; magent does not compute it from percents.
- `tumor_type` (string, required): Clive 2014 tumour type. mesothelioma or haematological (also hematological) scores 0; breast, gynaecological (also gynecological), or renal_cell scores 1; lung or other scores 2. magent does not assign tumour type from histology text.

## 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/lent`
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": [
    {
      "ecog": "0",
      "nlr": "5",
      "pleural_ldh_u_l": "1000",
      "tumor_type": "mesothelioma"
    },
    {
      "ecog": "0",
      "nlr": "5",
      "pleural_ldh_u_l": "1000",
      "tumor_type": "mesothelioma"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/lent",
  "items": [
    {
      "components": [
        {
          "value": 1.0e3,
          "factor": "pleural_ldh",
          "points": 0,
          "present": false
        },
        {
          "value": 0,
          "factor": "ecog",
          "points": 0,
          "present": true
        },
        {
          "value": 5.0,
          "factor": "nlr",
          "points": 0,
          "present": false
        },
        {
          "value": "mesothelioma",
          "factor": "tumor_type",
          "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": "Clive AO, Kahan BC, Hooper CE, Bhatnagar R, Morley AJ, Zahan-Evans N, Bintcliffe OJ, Boshuizen RC, Fysh ETH, Tobin CL, Medford ARL, Harvey JE, van den Heuvel MM, Lee YCG, Maskell NA",
        "doi": "10.1136/thoraxjnl-2014-205285",
        "id": "clive-2014",
        "pmid": "25100651",
        "source": "Thorax. 2014;69(12):1098-1104",
        "title": "Predicting survival in malignant pleural effusion: development and validation of the LENT prognostic score"
      },
      "formula": "lent",
      "formula_expression": "LENT = L (pleural LDH IU/L: <1500 → 0, >1500 → 1) + E (ECOG 0→0, 1→1, 2→2, 3-4→3) + N (serum NLR: <9 → 0, >9 → 1) + T (mesothelioma/haematological → 0; breast/gynaecological/renal_cell → 1; lung/other → 2); Clive 2014 Table 3; max 7; 0-1 low, 2-4 moderate, 5-7 high",
      "max_score": 7,
      "score": 0,
      "ecog": 0,
      "pleural_ldh_u_l": 1.0e3,
      "nlr": 5.0,
      "risk": "low",
      "tumor_type": "mesothelioma"
    },
    {
      "components": [
        {
          "value": 1.0e3,
          "factor": "pleural_ldh",
          "points": 0,
          "present": false
        },
        {
          "value": 0,
          "factor": "ecog",
          "points": 0,
          "present": true
        },
        {
          "value": 5.0,
          "factor": "nlr",
          "points": 0,
          "present": false
        },
        {
          "value": "mesothelioma",
          "factor": "tumor_type",
          "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": "Clive AO, Kahan BC, Hooper CE, Bhatnagar R, Morley AJ, Zahan-Evans N, Bintcliffe OJ, Boshuizen RC, Fysh ETH, Tobin CL, Medford ARL, Harvey JE, van den Heuvel MM, Lee YCG, Maskell NA",
        "doi": "10.1136/thoraxjnl-2014-205285",
        "id": "clive-2014",
        "pmid": "25100651",
        "source": "Thorax. 2014;69(12):1098-1104",
        "title": "Predicting survival in malignant pleural effusion: development and validation of the LENT prognostic score"
      },
      "formula": "lent",
      "formula_expression": "LENT = L (pleural LDH IU/L: <1500 → 0, >1500 → 1) + E (ECOG 0→0, 1→1, 2→2, 3-4→3) + N (serum NLR: <9 → 0, >9 → 1) + T (mesothelioma/haematological → 0; breast/gynaecological/renal_cell → 1; lung/other → 2); Clive 2014 Table 3; max 7; 0-1 low, 2-4 moderate, 5-7 high",
      "max_score": 7,
      "score": 0,
      "ecog": 0,
      "pleural_ldh_u_l": 1.0e3,
      "nlr": 5.0,
      "risk": "low",
      "tumor_type": "mesothelioma"
    }
  ]
}
```

## Response fields

- `formula` (string): lent
- `formula_expression` (string): Clive 2014 Table 3 LENT rule
- `score` (integer): LENT points 0-7
- `max_score` (integer): 7
- `risk` (string): low when score is 0-1, moderate when 2-4, high when 5-7 (Clive 2014). Not a diagnosis or treatment order. Paper median survivals 319 / 130 / 44 days are table numbers only.
- `pleural_ldh_u_l` (number): Pleural fluid LDH used, IU/L
- `ecog` (integer): Caller-assigned Oken 1982 ECOG grade 0-4
- `nlr` (number): Serum NLR used (caller-supplied number)
- `tumor_type` (string): Canonical Clive 2014 tumour token used for T
- `components` (array): L, E, N, and T points
- `citation` (object): Clive 2014 Thorax citation
- `disclaimer` (string): Not a medical device

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 1.0e3,
      "factor": "pleural_ldh",
      "points": 0,
      "present": false
    },
    {
      "value": 0,
      "factor": "ecog",
      "points": 0,
      "present": true
    },
    {
      "value": 5.0,
      "factor": "nlr",
      "points": 0,
      "present": false
    },
    {
      "value": "mesothelioma",
      "factor": "tumor_type",
      "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": "Clive AO, Kahan BC, Hooper CE, Bhatnagar R, Morley AJ, Zahan-Evans N, Bintcliffe OJ, Boshuizen RC, Fysh ETH, Tobin CL, Medford ARL, Harvey JE, van den Heuvel MM, Lee YCG, Maskell NA",
    "doi": "10.1136/thoraxjnl-2014-205285",
    "id": "clive-2014",
    "pmid": "25100651",
    "source": "Thorax. 2014;69(12):1098-1104",
    "title": "Predicting survival in malignant pleural effusion: development and validation of the LENT prognostic score"
  },
  "formula": "lent",
  "formula_expression": "LENT = L (pleural LDH IU/L: <1500 → 0, >1500 → 1) + E (ECOG 0→0, 1→1, 2→2, 3-4→3) + N (serum NLR: <9 → 0, >9 → 1) + T (mesothelioma/haematological → 0; breast/gynaecological/renal_cell → 1; lung/other → 2); Clive 2014 Table 3; max 7; 0-1 low, 2-4 moderate, 5-7 high",
  "max_score": 7,
  "score": 0,
  "ecog": 0,
  "pleural_ldh_u_l": 1.0e3,
  "nlr": 5.0,
  "risk": "low",
  "tumor_type": "mesothelioma"
}
```

## Errors

- HTTP 400 `invalid_lent_ldh`: pleural_ldh_u_l must be a number from 1 to 20000 and not 1500 (Clive 2014 LENT uses <1500 vs >1500). Returned before settlement; you are not charged.
- HTTP 400 `invalid_ecog_ps`: ecog must be an integer from 0 to 4 (Oken 1982). Grade 5 (dead) is not scored. Returned before settlement; you are not charged.
- HTTP 400 `invalid_lent_nlr`: nlr must be a number from 0.05 to 200 and not 9 (Clive 2014 LENT uses <9 vs >9). Returned before settlement; you are not charged.
- HTTP 400 `invalid_lent_tumor`: tumor_type must be mesothelioma, haematological, breast, gynaecological, renal_cell, lung, or other (Clive 2014 LENT). 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

- [Light's criteria](https://magentlab.com/docs/lights) — Apply Light 1972 pleural fluid criteria from protein ratio, LDH ratio, and pleural LDH versus two-thirds the laboratory LDH upper limit of normal.
- [NLR](https://magentlab.com/docs/nlr) — Compute the Zahorec 2001 neutrophil-to-lymphocyte ratio from relative neutrophil and lymphocyte percents.
- [ECOG](https://magentlab.com/docs/ecog) — Return the Oken 1982 ECOG performance status grade 0-4 from a caller-assigned integer, with a stable label.

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