# FUNC score

FUNC score

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

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

## What it computes

Compute the Rost 2008 FUNC score from caller-assigned ICH volume, age, location, GCS, and pre-ICH cognitive impairment.

## When to use

When an agent needs the published FUNC total and 90-day functional-independence band and must not invent volume, location, GCS, or pre-ICH cognition from a CT scan or chart narrative.

## When not to use

- Not a diagnosis and not a withdrawal-of-care protocol.
- Companion to the Hemphill ICH Score (30-day mortality), not a replacement.
- The caller assigns ICH volume, location, GCS, and pre-ICH cognitive impairment. magent does not read a CT scan or examine the patient.
- Rost 2008 reported observed 90-day functional independence (Glasgow Outcome Scale ≥4) of 0% (FUNC 0-4), 29% (5-7), 48% (8), 75% (9-10), and 95% (FUNC 11) in the published band table. Those are cohort proportions, not a care recommendation.
- The JSON response is score, max_score 11, and func_band. It does not include a percent independence table.

## Formula

```
FUNC = ich_volume + age + location + gcs + pre_ich_cognitive_impairment; volume <30 → 4, 30-60 → 2, >60 → 0; age <70 → 2, 70-79 → 1, >=80 → 0; lobar 2, deep 1, infratentorial 0; GCS >=9 → 2, <=8 → 0; pre-ICH cognitive impairment absent 1, present 0; max 11
```

## Citation

[Prediction of functional outcome in patients with primary intracerebral hemorrhage: the FUNC score](https://doi.org/10.1161/STROKEAHA.107.512202)
Rost NS, Smith EE, Chang Y, et al.
Stroke. 2008;39(8):2304-2309
DOI: [10.1161/STROKEAHA.107.512202](https://doi.org/10.1161/STROKEAHA.107.512202)

## Worked example

### Lobar ICH, small volume, GCS 14

Given: `age=60, gcs=14, ich_volume_ml=15, location=lobar, pre_ich_cognitive_impairment=false`

1. Volume 15 mL is <30 → 4; age 60 is <70 → 2; location lobar → 2
2. GCS 14 is ≥9 → 2; pre-ICH cognitive impairment absent → 1
3. Score = 11 (max 11), func_band 11


### Large infratentorial ICH, GCS 8, cognitive impairment

Given: `age=80, gcs=8, ich_volume_ml=70, location=infratentorial, pre_ich_cognitive_impairment=true`

1. Volume 70 mL is >60 → 0; age 80 is ≥80 → 0; location infratentorial → 0
2. GCS 8 is ≤8 → 0; pre-ICH cognitive impairment present → 0
3. Score = 0 (max 11), func_band 0-4


## Also searched as

- FUNC score
- FUNC ICH score
- Rost FUNC
- ICH functional outcome score
- primary ICH FUNC
- Rost 2008 FUNC
- functional independence ICH score
- FUNC 90-day ICH

## Parameters

- `ich_volume_ml` (number, required): ICH volume in mL (cm^3 in Rost 2008). Number from 0.1 to 300. <30 scores 4; 30-60 scores 2; >60 scores 0. magent does not measure volume from imaging.
- `age` (integer, required): Age in years (18-120). <70 scores 2; 70-79 scores 1; ≥80 scores 0.
- `location` (string, required): ICH location as assigned by the caller: lobar (2), deep (1), or infratentorial (0). magent does not read a CT scan.
- `gcs` (integer, required): Caller-assigned GCS total (integer 3-15). ≥9 scores 2; ≤8 scores 0. magent does not compute GCS from eye, verbal, and motor here.
- `pre_ich_cognitive_impairment` (boolean, required): Pre-ICH cognitive impairment as assigned by the caller. true or false. Absent (false) scores 1; present (true) scores 0.

## 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/func_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": [
    {
      "age": "60",
      "gcs": "14",
      "ich_volume_ml": "15",
      "location": "lobar",
      "pre_ich_cognitive_impairment": "false"
    },
    {
      "age": "60",
      "gcs": "14",
      "ich_volume_ml": "15",
      "location": "lobar",
      "pre_ich_cognitive_impairment": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/func_score",
  "items": [
    {
      "location": "lobar",
      "components": [
        {
          "value": 15.0,
          "factor": "ich_volume_ml",
          "points": 4,
          "present": true
        },
        {
          "value": 60,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "value": "lobar",
          "factor": "location",
          "points": 2,
          "present": true
        },
        {
          "value": 14,
          "factor": "gcs",
          "points": 2,
          "present": true
        },
        {
          "value": false,
          "factor": "pre_ich_cognitive_impairment",
          "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": "Rost NS, Smith EE, Chang Y, et al.",
        "doi": "10.1161/STROKEAHA.107.512202",
        "id": "rost-2008",
        "pmid": "18556582",
        "source": "Stroke. 2008;39(8):2304-2309",
        "title": "Prediction of functional outcome in patients with primary intracerebral hemorrhage: the FUNC score"
      },
      "formula": "func_score",
      "formula_expression": "FUNC = ich_volume + age + location + gcs + pre_ich_cognitive_impairment; volume <30 → 4, 30-60 → 2, >60 → 0; age <70 → 2, 70-79 → 1, >=80 → 0; lobar 2, deep 1, infratentorial 0; GCS >=9 → 2, <=8 → 0; pre-ICH cognitive impairment absent 1, present 0; max 11",
      "max_score": 11,
      "score": 11,
      "age_years": 60,
      "func_band": "11",
      "gcs": 14,
      "ich_volume_ml": 15.0,
      "pre_ich_cognitive_impairment": false
    },
    {
      "location": "lobar",
      "components": [
        {
          "value": 15.0,
          "factor": "ich_volume_ml",
          "points": 4,
          "present": true
        },
        {
          "value": 60,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "value": "lobar",
          "factor": "location",
          "points": 2,
          "present": true
        },
        {
          "value": 14,
          "factor": "gcs",
          "points": 2,
          "present": true
        },
        {
          "value": false,
          "factor": "pre_ich_cognitive_impairment",
          "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": "Rost NS, Smith EE, Chang Y, et al.",
        "doi": "10.1161/STROKEAHA.107.512202",
        "id": "rost-2008",
        "pmid": "18556582",
        "source": "Stroke. 2008;39(8):2304-2309",
        "title": "Prediction of functional outcome in patients with primary intracerebral hemorrhage: the FUNC score"
      },
      "formula": "func_score",
      "formula_expression": "FUNC = ich_volume + age + location + gcs + pre_ich_cognitive_impairment; volume <30 → 4, 30-60 → 2, >60 → 0; age <70 → 2, 70-79 → 1, >=80 → 0; lobar 2, deep 1, infratentorial 0; GCS >=9 → 2, <=8 → 0; pre-ICH cognitive impairment absent 1, present 0; max 11",
      "max_score": 11,
      "score": 11,
      "age_years": 60,
      "func_band": "11",
      "gcs": 14,
      "ich_volume_ml": 15.0,
      "pre_ich_cognitive_impairment": false
    }
  ]
}
```

## Response fields

- `formula` (string): func_score
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-11
- `max_score` (integer): Always 11
- `func_band` (string): Rost 2008 band: 0-4, 5-7, 8, 9-10, or 11
- `gcs` (integer): Caller-assigned GCS total used for the ≥9 / ≤8 split
- `age_years` (integer): Age used for the <70 / 70-79 / ≥80 bands
- `ich_volume_ml` (number): ICH volume in mL used for the <30 / 30-60 / >60 bands
- `location` (string): Caller-assigned location: lobar, deep, or infratentorial
- `pre_ich_cognitive_impairment` (boolean): Caller-assigned pre-ICH cognitive impairment flag
- `components` (array): Per-item points
- `citation` (object): Rost 2008 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "location": "lobar",
  "components": [
    {
      "value": 15.0,
      "factor": "ich_volume_ml",
      "points": 4,
      "present": true
    },
    {
      "value": 60,
      "factor": "age",
      "points": 2,
      "present": true
    },
    {
      "value": "lobar",
      "factor": "location",
      "points": 2,
      "present": true
    },
    {
      "value": 14,
      "factor": "gcs",
      "points": 2,
      "present": true
    },
    {
      "value": false,
      "factor": "pre_ich_cognitive_impairment",
      "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": "Rost NS, Smith EE, Chang Y, et al.",
    "doi": "10.1161/STROKEAHA.107.512202",
    "id": "rost-2008",
    "pmid": "18556582",
    "source": "Stroke. 2008;39(8):2304-2309",
    "title": "Prediction of functional outcome in patients with primary intracerebral hemorrhage: the FUNC score"
  },
  "formula": "func_score",
  "formula_expression": "FUNC = ich_volume + age + location + gcs + pre_ich_cognitive_impairment; volume <30 → 4, 30-60 → 2, >60 → 0; age <70 → 2, 70-79 → 1, >=80 → 0; lobar 2, deep 1, infratentorial 0; GCS >=9 → 2, <=8 → 0; pre-ICH cognitive impairment absent 1, present 0; max 11",
  "max_score": 11,
  "score": 11,
  "age_years": 60,
  "func_band": "11",
  "gcs": 14,
  "ich_volume_ml": 15.0,
  "pre_ich_cognitive_impairment": false
}
```

## Errors

- HTTP 400 `invalid_ich_volume`: ich_volume_ml must be a number from 0.1 to 300. Returned before settlement; you are not charged.
- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_func_location`: location must be lobar, deep, or infratentorial (Rost 2008). Returned before settlement; you are not charged.
- HTTP 400 `invalid_gcs_total`: gcs must be an integer from 3 to 15. 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_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

- [ICH Score](https://magentlab.com/docs/ich-score) — Compute the Hemphill 2001 ICH Score from caller-assigned GCS, age, infratentorial origin, ICH volume, and IVH.
- [ABC/2](https://magentlab.com/docs/abc2) — Compute the Kothari 1996 ABC/2 ellipsoid ICH volume as (a_cm × b_cm × c_cm) / 2 from caller-supplied diameters in centimeters.
- [Glasgow Coma Scale](https://magentlab.com/docs/gcs) — Compute the Glasgow Coma Scale as the sum of caller-assigned eye, verbal, and motor integers. The 1974 or 1976 edition is required.

## 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 echoing accepted, payload, and extensions when present).
- 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.
- 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.
