# STONE score for ureteral stone

STONE score

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

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

## What it computes

Sum the Moore 2014 STONE score for uncomplicated ureteral stone from five caller-assigned Table 3 items and return the 0-13 total plus low (0-5), moderate (6-9), or high (10-13) probability.

## When to use

When an agent has caller-assigned sex, pain timing, origin as used in Moore 2014, nausea, and dipstick hematuria for suspected uncomplicated ureteral stone in the emergency department and needs the published STONE total and band, not a CT order, stone diagnosis, or S.T.O.N.E. nephrolithometry.

## When not to use

- Not a medical device. Not a CT order or a ureteral stone diagnosis.
- Origin is caller-assigned as used in Moore 2014 Table 3 (Race: Black 0, Non-black 3). magent does not assign race.
- Sex, timing, nausea, and hematuria are caller-assigned. magent does not take a history, assign sex, read a dipstick, or order imaging.
- Not S.T.O.N.E. nephrolithometry (Okhunov 2013) for kidney calculi / PCNL.

## Formula

```
STONE = sex (female 0, male 2) + timing (gt_24h 0, 6_to_24h 1, lt_6h 3) + origin (black 0, nonblack 3) + nausea (none 0, nausea_alone 1, vomiting 2) + hematuria (absent 0, present 3); Moore 2014 Table 3; sum 0-13; 0-5 low, 6-9 moderate, 10-13 high
```

## Citation

[Derivation and validation of a clinical prediction rule for uncomplicated ureteral stone—the STONE score: retrospective and prospective observational cohort studies](https://doi.org/10.1136/bmj.g2191)
Moore CL, Bomann S, Daniels B, Luty S, Molinaro A, Singh D, Gross CP
BMJ. 2014;348:g2191
DOI: [10.1136/bmj.g2191](https://doi.org/10.1136/bmj.g2191)

## Worked example

### Male, pain <6 h, nonblack, vomiting, hematuria present

Given: `hematuria=true, nausea=vomiting, origin=nonblack, sex=male, timing=lt_6h`

1. male 2 + lt_6h 3 + nonblack 3 + vomiting 2 + hematuria present 3
2. Score = 13 (max 13); probability = high (10-13)


### Female, pain >24 h, black, no nausea, hematuria absent

Given: `hematuria=false, nausea=none, origin=black, sex=female, timing=gt_24h`

1. female 0 + gt_24h 0 + black 0 + none 0 + hematuria absent 0
2. Score = 0 (max 13); probability = low (0-5)


## Also searched as

- STONE score
- ureteral STONE
- Moore STONE score
- uncomplicated ureteral stone
- ED ureteral stone prediction
- Moore 2014 STONE
- Sex Timing Origin Nausea Erythrocytes
- ureteral stone clinical prediction rule

## Parameters

- `sex` (string, required): Caller-assigned sex (Moore 2014 Table 3). female scores 0; male scores 2. magent does not assign sex.
- `timing` (string, required): Caller-assigned duration of pain to presentation (Moore 2014 Table 3). gt_24h scores 0; 6_to_24h scores 1; lt_6h scores 3. magent does not timestamp onset.
- `origin` (string, required): Caller-assigned origin as used in Moore 2014 Table 3 (Race: Black 0, Non-black 3). black scores 0; nonblack scores 3. magent does not assign race.
- `nausea` (string, required): Caller-assigned nausea (Moore 2014 Table 3). none scores 0; nausea_alone scores 1; vomiting scores 2 (Table 3 vomiting alone). If vomiting is present use vomiting even if nausea is also present. magent does not take a history.
- `hematuria` (boolean, required): Caller-assigned erythrocytes / hematuria on urine dipstick (Moore 2014 Table 3). false (absent) scores 0; true (present) scores 3. Binary dipstick as in Table 3, not graded RBC counts. magent does not read a dipstick.

## 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_score`
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": [
    {
      "hematuria": "true",
      "nausea": "vomiting",
      "origin": "nonblack",
      "sex": "male",
      "timing": "lt_6h"
    },
    {
      "hematuria": "true",
      "nausea": "vomiting",
      "origin": "nonblack",
      "sex": "male",
      "timing": "lt_6h"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/stone_score",
  "items": [
    {
      "origin": "nonblack",
      "components": [
        {
          "value": "male",
          "factor": "sex",
          "points": 2,
          "present": true
        },
        {
          "value": "lt_6h",
          "factor": "timing",
          "points": 3,
          "present": true
        },
        {
          "value": "nonblack",
          "factor": "origin",
          "points": 3,
          "present": true
        },
        {
          "value": "vomiting",
          "factor": "nausea",
          "points": 2,
          "present": true
        },
        {
          "factor": "hematuria",
          "points": 3,
          "present": true
        }
      ],
      "timing": "lt_6h",
      "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": "Moore CL, Bomann S, Daniels B, Luty S, Molinaro A, Singh D, Gross CP",
        "doi": "10.1136/bmj.g2191",
        "id": "moore-2014-stone",
        "pmid": "24671981",
        "source": "BMJ. 2014;348:g2191",
        "title": "Derivation and validation of a clinical prediction rule for uncomplicated ureteral stone—the STONE score: retrospective and prospective observational cohort studies"
      },
      "formula": "stone_score",
      "formula_expression": "STONE = sex (female 0, male 2) + timing (gt_24h 0, 6_to_24h 1, lt_6h 3) + origin (black 0, nonblack 3) + nausea (none 0, nausea_alone 1, vomiting 2) + hematuria (absent 0, present 3); Moore 2014 Table 3; sum 0-13; 0-5 low, 6-9 moderate, 10-13 high",
      "max_score": 13,
      "score": 13,
      "sex": "male",
      "probability": "high",
      "derivation_stone_percent": 89.6,
      "hematuria": true,
      "nausea": "vomiting"
    },
    {
      "origin": "nonblack",
      "components": [
        {
          "value": "male",
          "factor": "sex",
          "points": 2,
          "present": true
        },
        {
          "value": "lt_6h",
          "factor": "timing",
          "points": 3,
          "present": true
        },
        {
          "value": "nonblack",
          "factor": "origin",
          "points": 3,
          "present": true
        },
        {
          "value": "vomiting",
          "factor": "nausea",
          "points": 2,
          "present": true
        },
        {
          "factor": "hematuria",
          "points": 3,
          "present": true
        }
      ],
      "timing": "lt_6h",
      "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": "Moore CL, Bomann S, Daniels B, Luty S, Molinaro A, Singh D, Gross CP",
        "doi": "10.1136/bmj.g2191",
        "id": "moore-2014-stone",
        "pmid": "24671981",
        "source": "BMJ. 2014;348:g2191",
        "title": "Derivation and validation of a clinical prediction rule for uncomplicated ureteral stone—the STONE score: retrospective and prospective observational cohort studies"
      },
      "formula": "stone_score",
      "formula_expression": "STONE = sex (female 0, male 2) + timing (gt_24h 0, 6_to_24h 1, lt_6h 3) + origin (black 0, nonblack 3) + nausea (none 0, nausea_alone 1, vomiting 2) + hematuria (absent 0, present 3); Moore 2014 Table 3; sum 0-13; 0-5 low, 6-9 moderate, 10-13 high",
      "max_score": 13,
      "score": 13,
      "sex": "male",
      "probability": "high",
      "derivation_stone_percent": 89.6,
      "hematuria": true,
      "nausea": "vomiting"
    }
  ]
}
```

## Response fields

- `formula` (string): stone_score
- `formula_expression` (string): Exact expression used
- `score` (integer): Moore 2014 STONE integer 0-13. Not a CT order or stone diagnosis.
- `max_score` (integer): 13
- `probability` (string): low when score is 0-5, moderate when 6-9, high when 10-13 (Moore 2014 derivation/validation bands). Not a stone diagnosis.
- `derivation_stone_percent` (number): Moore 2014 derivation ureteral-stone percent for the band: 8.3 (low), 51.6 (moderate), 89.6 (high). One decimal from that paper.
- `sex` (string): Caller-assigned sex used (female or male)
- `timing` (string): Caller-assigned timing used (gt_24h, 6_to_24h, or lt_6h)
- `origin` (string): Caller-assigned origin used (black or nonblack)
- `nausea` (string): Caller-assigned nausea used (none, nausea_alone, or vomiting)
- `hematuria` (boolean): Caller-assigned dipstick hematuria used (true present, false absent)
- `components` (array): Per-item Moore 2014 Table 3 points
- `citation` (object): Moore et al. BMJ 2014 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "origin": "nonblack",
  "components": [
    {
      "value": "male",
      "factor": "sex",
      "points": 2,
      "present": true
    },
    {
      "value": "lt_6h",
      "factor": "timing",
      "points": 3,
      "present": true
    },
    {
      "value": "nonblack",
      "factor": "origin",
      "points": 3,
      "present": true
    },
    {
      "value": "vomiting",
      "factor": "nausea",
      "points": 2,
      "present": true
    },
    {
      "factor": "hematuria",
      "points": 3,
      "present": true
    }
  ],
  "timing": "lt_6h",
  "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": "Moore CL, Bomann S, Daniels B, Luty S, Molinaro A, Singh D, Gross CP",
    "doi": "10.1136/bmj.g2191",
    "id": "moore-2014-stone",
    "pmid": "24671981",
    "source": "BMJ. 2014;348:g2191",
    "title": "Derivation and validation of a clinical prediction rule for uncomplicated ureteral stone—the STONE score: retrospective and prospective observational cohort studies"
  },
  "formula": "stone_score",
  "formula_expression": "STONE = sex (female 0, male 2) + timing (gt_24h 0, 6_to_24h 1, lt_6h 3) + origin (black 0, nonblack 3) + nausea (none 0, nausea_alone 1, vomiting 2) + hematuria (absent 0, present 3); Moore 2014 Table 3; sum 0-13; 0-5 low, 6-9 moderate, 10-13 high",
  "max_score": 13,
  "score": 13,
  "sex": "male",
  "probability": "high",
  "derivation_stone_percent": 89.6,
  "hematuria": true,
  "nausea": "vomiting"
}
```

## Errors

- HTTP 400 `invalid_sex`: sex must be female or male Returned before settlement; you are not charged.
- HTTP 400 `invalid_stone_score`: STONE inputs must match Moore 2014 sex, timing, origin, nausea, and dipstick hematuria. 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

- [STONE nephrolithometry](https://magentlab.com/docs/stone-nephrolithometry) — 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.

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