# Neck Disability Index

NDI

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

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

## What it computes

Sum ten caller-assigned Vernon 1991 Neck Disability Index sections (each integer 0-5) and return the published 0-50 total with that paper's raw-score disability bands.

## When to use

When an agent already has Vernon 1991 integers 0-5 for the ten NDI sections and needs the published total and raw 0-50 bands. magent does not interview the patient, diagnose neck disease, score Oswestry, or apply later percentage website cutoffs.

## When not to use

- Not a medical device and not a diagnosis of neck pathology or a treatment order.
- Each of the ten sections is a caller-assigned integer 0-5. magent does not interview the patient.
- Vernon 1991 scored the raw 0-50 total. Bands are 0-4 none, 5-14 mild, 15-24 moderate, 25-34 severe, and >34 complete. magent does not convert to a 0-100 percent or apply later 0-8%/10-28% website percentage bands.
- This is Vernon 1991 NDI only. magent does not score the Oswestry Low Back Pain Disability Questionnaire.

## Formula

```
NDI = pain_intensity + personal_care + lifting + reading + headaches + concentration + work + driving + sleeping + recreation; each caller-assigned 0-5; Vernon 1991 ten sections; max 50; raw 0-50 bands 0-4 none, 5-14 mild, 15-24 moderate, 25-34 severe, >34 complete
```

## Citation

[The Neck Disability Index: a study of reliability and validity](https://pubmed.ncbi.nlm.nih.gov/1834753)
Vernon H, Mior S
J Manipulative Physiol Ther. 1991;14(7):409-415
DOI: none

## Worked example

### All items 0

Given: `concentration=0, driving=0, headaches=0, lifting=0, pain_intensity=0, personal_care=0, reading=0, recreation=0, sleeping=0, work=0`

1. pain_intensity, personal_care, lifting, reading, headaches, concentration, work, driving, sleeping, and recreation are 0 as assigned by the caller
2. Score = 0 (max 50); disability none (Vernon 1991 raw 0-4)


### All items 5

Given: `concentration=5, driving=5, headaches=5, lifting=5, pain_intensity=5, personal_care=5, reading=5, recreation=5, sleeping=5, work=5`

1. each of the ten Vernon 1991 sections is 5 as assigned by the caller
2. Score = 50 (max 50); disability complete (Vernon 1991 raw >34)


## Also searched as

- NDI
- Neck Disability Index
- Vernon NDI
- neck pain disability
- NDI score
- Vernon 1991 NDI
- cervical disability index
- neck disability questionnaire
- NDI 0-50

## Parameters

- `pain_intensity` (integer, required): Caller-assigned Vernon 1991 NDI pain intensity (integer 0-5): 0 no pain at the moment through 5 worst imaginable pain at the moment. magent does not interview the patient.
- `personal_care` (integer, required): Caller-assigned Vernon 1991 NDI personal care (washing, dressing) (integer 0-5): 0 looks after self normally without extra pain through 5 does not get dressed, washes with difficulty and stays in bed. magent does not interview the patient.
- `lifting` (integer, required): Caller-assigned Vernon 1991 NDI lifting (integer 0-5): 0 can lift heavy weights without extra pain through 5 cannot lift or carry anything. magent does not interview the patient.
- `reading` (integer, required): Caller-assigned Vernon 1991 NDI reading (integer 0-5): 0 can read as much as wanted with no neck pain through 5 cannot read at all. magent does not interview the patient.
- `headaches` (integer, required): Caller-assigned Vernon 1991 NDI headaches (integer 0-5): 0 no headaches through 5 headaches almost all the time. magent does not interview the patient.
- `concentration` (integer, required): Caller-assigned Vernon 1991 NDI concentration (integer 0-5): 0 can concentrate fully with no difficulty through 5 cannot concentrate at all. magent does not interview the patient.
- `work` (integer, required): Caller-assigned Vernon 1991 NDI work (integer 0-5): 0 can do as much work as wanted through 5 cannot do any work at all. magent does not interview the patient.
- `driving` (integer, required): Caller-assigned Vernon 1991 NDI driving (integer 0-5): 0 can drive without neck pain through 5 cannot drive at all. magent does not interview the patient.
- `sleeping` (integer, required): Caller-assigned Vernon 1991 NDI sleeping (integer 0-5): 0 no trouble sleeping through 5 sleep completely disturbed (5-7 hours sleepless). magent does not interview the patient.
- `recreation` (integer, required): Caller-assigned Vernon 1991 NDI recreation (integer 0-5): 0 can engage in all recreation activities with no neck pain through 5 cannot do any recreation activities. magent does not interview the patient.

## 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/ndi`
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": [
    {
      "concentration": "0",
      "driving": "0",
      "headaches": "0",
      "lifting": "0",
      "pain_intensity": "0",
      "personal_care": "0",
      "reading": "0",
      "recreation": "0",
      "sleeping": "0",
      "work": "0"
    },
    {
      "concentration": "0",
      "driving": "0",
      "headaches": "0",
      "lifting": "0",
      "pain_intensity": "0",
      "personal_care": "0",
      "reading": "0",
      "recreation": "0",
      "sleeping": "0",
      "work": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/ndi",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "pain_intensity",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "personal_care",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lifting",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "reading",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "headaches",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "concentration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "work",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "driving",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sleeping",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "recreation",
          "points": 0,
          "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": "Vernon H, Mior S",
        "id": "vernon-1991",
        "pmid": "1834753",
        "source": "J Manipulative Physiol Ther. 1991;14(7):409-415",
        "title": "The Neck Disability Index: a study of reliability and validity"
      },
      "formula": "ndi",
      "formula_expression": "NDI = pain_intensity + personal_care + lifting + reading + headaches + concentration + work + driving + sleeping + recreation; each caller-assigned 0-5; Vernon 1991 ten sections; max 50; raw 0-50 bands 0-4 none, 5-14 mild, 15-24 moderate, 25-34 severe, >34 complete",
      "max_score": 50,
      "score": 0,
      "disability": "none"
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "pain_intensity",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "personal_care",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lifting",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "reading",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "headaches",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "concentration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "work",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "driving",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sleeping",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "recreation",
          "points": 0,
          "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": "Vernon H, Mior S",
        "id": "vernon-1991",
        "pmid": "1834753",
        "source": "J Manipulative Physiol Ther. 1991;14(7):409-415",
        "title": "The Neck Disability Index: a study of reliability and validity"
      },
      "formula": "ndi",
      "formula_expression": "NDI = pain_intensity + personal_care + lifting + reading + headaches + concentration + work + driving + sleeping + recreation; each caller-assigned 0-5; Vernon 1991 ten sections; max 50; raw 0-50 bands 0-4 none, 5-14 mild, 15-24 moderate, 25-34 severe, >34 complete",
      "max_score": 50,
      "score": 0,
      "disability": "none"
    }
  ]
}
```

## Response fields

- `formula` (string): ndi
- `formula_expression` (string): Exact expression used
- `score` (integer): Vernon 1991 sum of ten caller-assigned 0-5 sections (total 0-50)
- `max_score` (integer): Always 50
- `disability` (string): Vernon 1991 raw 0-50 bands: none (0-4), mild (5-14), moderate (15-24), severe (25-34), complete (>34). Not a diagnosis.
- `components` (array): Per-section caller-assigned points
- `citation` (object): Vernon and Mior J Manipulative Physiol Ther 1991 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "pain_intensity",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "personal_care",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "lifting",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "reading",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "headaches",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "concentration",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "work",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "driving",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "sleeping",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "recreation",
      "points": 0,
      "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": "Vernon H, Mior S",
    "id": "vernon-1991",
    "pmid": "1834753",
    "source": "J Manipulative Physiol Ther. 1991;14(7):409-415",
    "title": "The Neck Disability Index: a study of reliability and validity"
  },
  "formula": "ndi",
  "formula_expression": "NDI = pain_intensity + personal_care + lifting + reading + headaches + concentration + work + driving + sleeping + recreation; each caller-assigned 0-5; Vernon 1991 ten sections; max 50; raw 0-50 bands 0-4 none, 5-14 mild, 15-24 moderate, 25-34 severe, >34 complete",
  "max_score": 50,
  "score": 0,
  "disability": "none"
}
```

## Errors

- HTTP 400 `invalid_ndi`: NDI needs the ten Vernon 1991 sections each as an integer 0-5. Returned before settlement; you are not charged.
- HTTP 400 `invalid_ndi_item`: each NDI section must be an integer from 0 to 5 (Vernon 1991). 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

- [Barthel Index](https://magentlab.com/docs/barthel) — Sum ten caller-assigned Mahoney 1965 Barthel Index item points and return the published 0-100 total.
- [Modified Rankin](https://magentlab.com/docs/modified-rankin) — Return the van Swieten 1988 modified Rankin handicap grade 0-5 from a caller-assigned integer, with the published grade wording.

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