# Risk of malignancy index (RMI)

RMI

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

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

## What it computes

Compute the Jacobs 1990 risk of malignancy index as ultrasound score × menopausal score × CA125 (U/ml), then whether that product exceeds the published cutoff of 200.

## When to use

When an agent has a caller-assigned ultrasound score (0, 1, or 3), postmenopausal flag, and CA125 in U/ml and needs the published Jacobs 1990 RMI and >200 cutoff, not a diagnosis of ovarian cancer and not later RMI-2 or RMI-3.

## When not to use

- Not a medical device. magent does not diagnose ovarian cancer.
- Jacobs 1990 RMI (RMI-I) only. Not later RMI-2 or RMI-3.
- Caller assigns ultrasound_score (0 if no features, 1 if one of the five findings, 3 if two or more) and postmenopausal (more than one year since final period, or age >50 after hysterectomy). magent does not read ultrasound or date menses.
- Published cutoff is RMI > 200 (exactly 200 does not exceed). magent does not invent probability tiers.

## Formula

```
RMI = U × M × CA125 (U/ml); U is ultrasound_score 0, 1, or 3 (never 2); M is 1 if premenopausal, 3 if postmenopausal; exceeds_200 if RMI > 200 (Jacobs 1990)
```

## Citation

[A risk of malignancy index incorporating CA 125, ultrasound and menopausal status for the accurate preoperative diagnosis of ovarian cancer](https://doi.org/10.1111/j.1471-0528.1990.tb02448.x)
Jacobs I, Oram D, Fairbanks J, Turner J, Frost C, Grudzinskas JG
Br J Obstet Gynaecol. 1990;97(10):922-929
DOI: [10.1111/j.1471-0528.1990.tb02448.x](https://doi.org/10.1111/j.1471-0528.1990.tb02448.x)

## Worked example

### CA125 50 U/ml, ultrasound 3, postmenopausal (exceeds 200)

Given: `ca125_u_ml=50, postmenopausal=true, ultrasound_score=3`

1. U = 3 (two or more ultrasound features)
2. M = 3 (postmenopausal)
3. RMI = 3 × 3 × 50 = 450.0
4. 450.0 > 200 → exceeds_200 true


### CA125 200 U/ml, ultrasound 1, premenopausal (exactly 200)

Given: `ca125_u_ml=200, postmenopausal=false, ultrasound_score=1`

1. U = 1, M = 1, CA125 = 200
2. RMI = 1 × 1 × 200 = 200.0
3. 200.0 is not > 200 → exceeds_200 false


## Also searched as

- risk of malignancy index
- RMI-I
- Jacobs RMI
- CA125 ultrasound menopausal
- ovarian malignancy index
- RMI score
- Jacobs 1990 RMI

## Parameters

- `ca125_u_ml` (number, required): Serum CA125 in U/ml (0-50000). Enters the product unrounded. Jacobs 1990 uses U/ml. magent does not assay CA125.
- `ultrasound_score` (integer, required): Caller-assigned Jacobs 1990 ultrasound score: 0 if no features, 1 if one feature, 3 if two or more of multilocular cyst, solid areas, bilateral lesions, ascites, or intra-abdominal metastases. Never 2. magent does not read ultrasound.
- `postmenopausal` (boolean, required): true if postmenopausal (M=3), false if premenopausal (M=1). Jacobs 1990: more than one year since final period, or age >50 after hysterectomy. Caller sets the flag; magent does not date menses.

## 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/rmi`
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": [
    {
      "ca125_u_ml": "50",
      "postmenopausal": "true",
      "ultrasound_score": "3"
    },
    {
      "ca125_u_ml": "50",
      "postmenopausal": "true",
      "ultrasound_score": "3"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/rmi",
  "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": "Jacobs I, Oram D, Fairbanks J, Turner J, Frost C, Grudzinskas JG",
        "doi": "10.1111/j.1471-0528.1990.tb02448.x",
        "id": "jacobs-1990-rmi",
        "pmid": "2223684",
        "source": "Br J Obstet Gynaecol. 1990;97(10):922-929",
        "title": "A risk of malignancy index incorporating CA 125, ultrasound and menopausal status for the accurate preoperative diagnosis of ovarian cancer"
      },
      "formula": "rmi",
      "formula_expression": "RMI = U × M × CA125 (U/ml); U is ultrasound_score 0, 1, or 3 (never 2); M is 1 if premenopausal, 3 if postmenopausal; exceeds_200 if RMI > 200 (Jacobs 1990)",
      "ca125_u_ml": 50.0,
      "exceeds_200": true,
      "postmenopausal": true,
      "rmi": 450.0,
      "ultrasound_score": 3
    },
    {
      "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": "Jacobs I, Oram D, Fairbanks J, Turner J, Frost C, Grudzinskas JG",
        "doi": "10.1111/j.1471-0528.1990.tb02448.x",
        "id": "jacobs-1990-rmi",
        "pmid": "2223684",
        "source": "Br J Obstet Gynaecol. 1990;97(10):922-929",
        "title": "A risk of malignancy index incorporating CA 125, ultrasound and menopausal status for the accurate preoperative diagnosis of ovarian cancer"
      },
      "formula": "rmi",
      "formula_expression": "RMI = U × M × CA125 (U/ml); U is ultrasound_score 0, 1, or 3 (never 2); M is 1 if premenopausal, 3 if postmenopausal; exceeds_200 if RMI > 200 (Jacobs 1990)",
      "ca125_u_ml": 50.0,
      "exceeds_200": true,
      "postmenopausal": true,
      "rmi": 450.0,
      "ultrasound_score": 3
    }
  ]
}
```

## Response fields

- `formula` (string): rmi
- `formula_expression` (string): Exact Jacobs 1990 expression
- `ca125_u_ml` (number): CA125 used in U/ml, unrounded in the product
- `ultrasound_score` (integer): U used: 0, 1, or 3 (never 2)
- `postmenopausal` (boolean): Menopausal flag used (true → M=3, false → M=1)
- `rmi` (number): U × M × CA125, 1 decimal (Jacobs 1990). Not a diagnosis.
- `exceeds_200` (boolean): true if RMI > 200 (Jacobs 1990 published cutoff). Exactly 200 is false.
- `citation` (object): Jacobs 1990 BJOG citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Jacobs I, Oram D, Fairbanks J, Turner J, Frost C, Grudzinskas JG",
    "doi": "10.1111/j.1471-0528.1990.tb02448.x",
    "id": "jacobs-1990-rmi",
    "pmid": "2223684",
    "source": "Br J Obstet Gynaecol. 1990;97(10):922-929",
    "title": "A risk of malignancy index incorporating CA 125, ultrasound and menopausal status for the accurate preoperative diagnosis of ovarian cancer"
  },
  "formula": "rmi",
  "formula_expression": "RMI = U × M × CA125 (U/ml); U is ultrasound_score 0, 1, or 3 (never 2); M is 1 if premenopausal, 3 if postmenopausal; exceeds_200 if RMI > 200 (Jacobs 1990)",
  "ca125_u_ml": 50.0,
  "exceeds_200": true,
  "postmenopausal": true,
  "rmi": 450.0,
  "ultrasound_score": 3
}
```

## Errors

- HTTP 400 `invalid_ca125`: ca125_u_ml must be a number from 0 to 50000. Returned before settlement; you are not charged.
- HTTP 400 `invalid_ultrasound_score`: ultrasound_score must be 0, 1, or 3 (Jacobs 1990; never 2). Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_rmi`: RMI needs CA125 (U/ml), ultrasound_score 0, 1, or 3, and postmenopausal as used in Jacobs 1990. 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

- [GPS](https://magentlab.com/docs/gps) — Apply the Forrest 2003 original Glasgow Prognostic Score (GPS) from caller-supplied CRP in mg/L and albumin.
- [mGPS](https://magentlab.com/docs/mgps) — Apply the McMillan 2007 modified Glasgow Prognostic Score (mGPS) from caller-supplied CRP in mg/L and albumin.
- [MAPS](https://magentlab.com/docs/maps) — Sum the Pardanani 2018 MAPS hybrid clinical-molecular (Figure 3) points for systemic mastocytosis and return low (≤2), intermediate_1 (3), intermediate_2 (4), or high (≥5).

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