# STONE nephrolithometry

STONE nephrolithometry

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

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

## What it computes

Sum the Okhunov 2013 STONE nephrolithometry score for kidney calculi (PCNL) from five caller-assigned published item points and return the integer total (5–13). Does not return stone-free-rate bands.

## When to use

When an agent has already assigned Okhunov 2013 size (mm²), tract length, hydronephrosis, involved calyces or staghorn, and Hounsfield-unit essence for renal calculi planned for PCNL and needs the published integer sum, not a PCNL order, CT read, or the ureteral STONE score.

## When not to use

- Not a medical device. magent does not measure stone size, tract, hydronephrosis, calyces, or HU. Size, tract, obstruction, calyces, and essence are caller-assigned.
- Not an operative or PCNL order. The score is not a command to operate, place a tract, or choose a percutaneous approach.
- Not the Moore 2014 ureteral STONE score. This tool is Okhunov 2013 STONE nephrolithometry for kidney calculi / PCNL.
- Okhunov 2013 correlated score with stone-free rate but did not publish exclusive SFR cutoffs. magent returns score and max_score only.

## Formula

```
STONE = size (0_399 1, 400_799 2, 800_1599 3, ge_1600 4) + tract (le_100 1, gt_100 2) + obstruction (none_or_mild 1, moderate_or_severe 2) + calyces (1_or_2 1, 3 2, staghorn 3) + essence (le_950 1, gt_950 2); Okhunov 2013 STONE nephrolithometry; sum 5-13; no published SFR bands
```

## Citation

[S.T.O.N.E. nephrolithometry: novel surgical classification system for kidney calculi](https://doi.org/10.1016/j.urology.2012.10.083)
Okhunov Z, Friedlander JI, George AK, Duty BD, Moreira DM, Srinivasan AK, Hillelsohn J, Smith AD, Okeke Z
Urology. 2013;81(6):1154-1159
DOI: [10.1016/j.urology.2012.10.083](https://doi.org/10.1016/j.urology.2012.10.083)

## Worked example

### All minimum grades

Given: `calyces=1_or_2, essence=le_950, obstruction=none_or_mild, size=0_399, tract=le_100`

1. 0_399 1 + le_100 1 + none_or_mild 1 + 1_or_2 1 + le_950 1
2. Score = 5 (max 13). No SFR band. Not a PCNL order


### All maximum grades

Given: `calyces=staghorn, essence=gt_950, obstruction=moderate_or_severe, size=ge_1600, tract=gt_100`

1. ge_1600 4 + gt_100 2 + moderate_or_severe 2 + staghorn 3 + gt_950 2
2. Score = 13 (max 13). No SFR band. Not a PCNL order


## Also searched as

- Okhunov STONE
- STONE score renal calculi
- PCNL nephrolithometry
- STONE nephrolithometry
- Okhunov 2013
- renal STONE score
- PCNL stone score
- S.T.O.N.E. nephrolithometry

## Parameters

- `size` (string, required): Caller-assigned stone size in mm² (Okhunov 2013). 0_399 (0–399 mm²) scores 1; 400_799 (400–799 mm²) scores 2; 800_1599 (800–1599 mm²) scores 3; ge_1600 (≥1600 mm²) scores 4. magent does not measure stone size or CT.
- `tract` (string, required): Caller-assigned tract length in mm, skin-to-stone (Okhunov 2013). le_100 (≤100 mm) scores 1; gt_100 (>100 mm) scores 2. magent does not measure tract length or CT.
- `obstruction` (string, required): Caller-assigned hydronephrosis / obstruction (Okhunov 2013). none_or_mild scores 1; moderate_or_severe scores 2. magent does not measure hydronephrosis or CT.
- `calyces` (string, required): Caller-assigned number of involved calyces or staghorn (Okhunov 2013). 1_or_2 scores 1; 3 scores 2; staghorn scores 3. magent does not count calyces or read CT.
- `essence` (string, required): Caller-assigned stone density in Hounsfield units (Okhunov 2013 essence). le_950 (≤950 HU) scores 1; gt_950 (>950 HU) scores 2. magent does not measure HU or CT.

## 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/stone_nephrolithometry`
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": [
    {
      "calyces": "1_or_2",
      "essence": "le_950",
      "obstruction": "none_or_mild",
      "size": "0_399",
      "tract": "le_100"
    },
    {
      "calyces": "1_or_2",
      "essence": "le_950",
      "obstruction": "none_or_mild",
      "size": "0_399",
      "tract": "le_100"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/stone_nephrolithometry",
  "items": [
    {
      "size": "0_399",
      "components": [
        {
          "value": "0_399",
          "factor": "size",
          "points": 1,
          "present": true
        },
        {
          "value": "le_100",
          "factor": "tract",
          "points": 1,
          "present": true
        },
        {
          "value": "none_or_mild",
          "factor": "obstruction",
          "points": 1,
          "present": true
        },
        {
          "value": "1_or_2",
          "factor": "calyces",
          "points": 1,
          "present": true
        },
        {
          "value": "le_950",
          "factor": "essence",
          "points": 1,
          "present": true
        }
      ],
      "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": "Okhunov Z, Friedlander JI, George AK, Duty BD, Moreira DM, Srinivasan AK, Hillelsohn J, Smith AD, Okeke Z",
        "doi": "10.1016/j.urology.2012.10.083",
        "id": "okhunov-2013",
        "pmid": "23540858",
        "source": "Urology. 2013;81(6):1154-1159",
        "title": "S.T.O.N.E. nephrolithometry: novel surgical classification system for kidney calculi"
      },
      "formula": "stone_nephrolithometry",
      "formula_expression": "STONE = size (0_399 1, 400_799 2, 800_1599 3, ge_1600 4) + tract (le_100 1, gt_100 2) + obstruction (none_or_mild 1, moderate_or_severe 2) + calyces (1_or_2 1, 3 2, staghorn 3) + essence (le_950 1, gt_950 2); Okhunov 2013 STONE nephrolithometry; sum 5-13; no published SFR bands",
      "max_score": 13,
      "score": 5,
      "calyces": "1_or_2",
      "essence": "le_950",
      "obstruction": "none_or_mild",
      "tract": "le_100"
    },
    {
      "size": "0_399",
      "components": [
        {
          "value": "0_399",
          "factor": "size",
          "points": 1,
          "present": true
        },
        {
          "value": "le_100",
          "factor": "tract",
          "points": 1,
          "present": true
        },
        {
          "value": "none_or_mild",
          "factor": "obstruction",
          "points": 1,
          "present": true
        },
        {
          "value": "1_or_2",
          "factor": "calyces",
          "points": 1,
          "present": true
        },
        {
          "value": "le_950",
          "factor": "essence",
          "points": 1,
          "present": true
        }
      ],
      "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": "Okhunov Z, Friedlander JI, George AK, Duty BD, Moreira DM, Srinivasan AK, Hillelsohn J, Smith AD, Okeke Z",
        "doi": "10.1016/j.urology.2012.10.083",
        "id": "okhunov-2013",
        "pmid": "23540858",
        "source": "Urology. 2013;81(6):1154-1159",
        "title": "S.T.O.N.E. nephrolithometry: novel surgical classification system for kidney calculi"
      },
      "formula": "stone_nephrolithometry",
      "formula_expression": "STONE = size (0_399 1, 400_799 2, 800_1599 3, ge_1600 4) + tract (le_100 1, gt_100 2) + obstruction (none_or_mild 1, moderate_or_severe 2) + calyces (1_or_2 1, 3 2, staghorn 3) + essence (le_950 1, gt_950 2); Okhunov 2013 STONE nephrolithometry; sum 5-13; no published SFR bands",
      "max_score": 13,
      "score": 5,
      "calyces": "1_or_2",
      "essence": "le_950",
      "obstruction": "none_or_mild",
      "tract": "le_100"
    }
  ]
}
```

## Response fields

- `formula` (string): stone_nephrolithometry
- `formula_expression` (string): Exact expression used
- `score` (integer): Okhunov 2013 STONE nephrolithometry integer sum 5-13. Not a PCNL order. No published SFR band.
- `max_score` (integer): 13
- `size` (string): Caller-assigned size used (0_399, 400_799, 800_1599, or ge_1600)
- `tract` (string): Caller-assigned tract used (le_100 or gt_100)
- `obstruction` (string): Caller-assigned obstruction used (none_or_mild or moderate_or_severe)
- `calyces` (string): Caller-assigned calyces used (1_or_2, 3, or staghorn)
- `essence` (string): Caller-assigned essence used (le_950 or gt_950)
- `components` (array): Per-item Okhunov 2013 points
- `citation` (object): Okhunov et al. Urology 2013 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "size": "0_399",
  "components": [
    {
      "value": "0_399",
      "factor": "size",
      "points": 1,
      "present": true
    },
    {
      "value": "le_100",
      "factor": "tract",
      "points": 1,
      "present": true
    },
    {
      "value": "none_or_mild",
      "factor": "obstruction",
      "points": 1,
      "present": true
    },
    {
      "value": "1_or_2",
      "factor": "calyces",
      "points": 1,
      "present": true
    },
    {
      "value": "le_950",
      "factor": "essence",
      "points": 1,
      "present": true
    }
  ],
  "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": "Okhunov Z, Friedlander JI, George AK, Duty BD, Moreira DM, Srinivasan AK, Hillelsohn J, Smith AD, Okeke Z",
    "doi": "10.1016/j.urology.2012.10.083",
    "id": "okhunov-2013",
    "pmid": "23540858",
    "source": "Urology. 2013;81(6):1154-1159",
    "title": "S.T.O.N.E. nephrolithometry: novel surgical classification system for kidney calculi"
  },
  "formula": "stone_nephrolithometry",
  "formula_expression": "STONE = size (0_399 1, 400_799 2, 800_1599 3, ge_1600 4) + tract (le_100 1, gt_100 2) + obstruction (none_or_mild 1, moderate_or_severe 2) + calyces (1_or_2 1, 3 2, staghorn 3) + essence (le_950 1, gt_950 2); Okhunov 2013 STONE nephrolithometry; sum 5-13; no published SFR bands",
  "max_score": 13,
  "score": 5,
  "calyces": "1_or_2",
  "essence": "le_950",
  "obstruction": "none_or_mild",
  "tract": "le_100"
}
```

## Errors

- HTTP 400 `invalid_stone_nephrolithometry`: size must be 0_399, 400_799, 800_1599, or ge_1600; tract must be le_100 or gt_100; obstruction must be none_or_mild or moderate_or_severe; calyces must be 1_or_2, 3, or staghorn; essence must be le_950 or gt_950 (Okhunov 2013 STONE nephrolithometry). 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

- [Urine PCR](https://magentlab.com/docs/urine-pcr) — Compute the Ginsberg 1983 urine protein/creatinine ratio (mg/mg) from a single-void urine protein and urine creatinine, and return that rounded ratio as estimated_g_day (numeric estimate of 24-h protein g/day).

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