Emergency · LIVE
STONE score for ureteral stone
STONE score
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.
Markdown: /docs/stone-score.md · Canonical: https://magentlab.com/docs/stone-score
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
- Authors
- Moore CL, Bomann S, Daniels B, Luty S, Molinaro A, Singh D, Gross CP
- Source
- BMJ. 2014;348:g2191
Worked example
Male, pain <6 h, nonblack, vomiting, hematuria present
Given:
hematuria=truenausea=vomitingorigin=nonblacksex=maletiming=lt_6h
- male 2 + lt_6h 3 + nonblack 3 + vomiting 2 + hematuria present 3
- Score = 13 (max 13); probability = high (10-13)
Female, pain >24 h, black, no nausea, hematuria absent
Given:
hematuria=falsenausea=noneorigin=blacksex=femaletiming=gt_24h
- female 0 + gt_24h 0 + black 0 + none 0 + hematuria absent 0
- 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
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/stone_score?sex=male&timing=lt_6h&origin=nonblack&nausea=vomiting&hematuria=true
Full URL: https://api.magentlab.com/api/calc/stone_score?sex=male&timing=lt_6h&origin=nonblack&nausea=vomiting&hematuria=true
Call
Expect HTTP 402 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/stone_score?sex=male&timing=lt_6h&origin=nonblack&nausea=vomiting&hematuria=true"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sex |
string | required · female, male | Caller-assigned sex (Moore 2014 Table 3). female scores 0; male scores 2. magent does not assign sex. |
timing |
string | required · gt_24h, 6_to_24h, lt_6h | 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 · black, nonblack | 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 · none, nausea_alone, vomiting | 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.
- 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 (fixture)
{
"items": [
{
"hematuria": "true",
"nausea": "vomiting",
"origin": "nonblack",
"sex": "male",
"timing": "lt_6h"
},
{
"hematuria": "true",
"nausea": "vomiting",
"origin": "nonblack",
"sex": "male",
"timing": "lt_6h"
}
]
}
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/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
| Field | Type | Description |
|---|---|---|
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
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_sex |
sex must be female or male Returned before settlement; you are not charged. |
| 400 | invalid_stone_score |
STONE inputs must match Moore 2014 sex, timing, origin, nausea, and dipstick hematuria. 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. |
Related tools
- 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. 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.
Stdio MCP: /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.