# Major Depression Inventory

MDI

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

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

## What it computes

Map 12 caller-assigned Bech 2001 MDI integers (0-5 over the last 2 weeks) to ten DSM-IV/ICD-10 symptom items (appetite and psychomotor are each the published max of their pair) and return the 0-50 total and whether it meets this paper's optimal cutoff of 26.

## When to use

When an agent has already assigned Bech 2001 MDI 0-5 integers for all 12 printed items and needs the published ten-item total and cutoff of 26, not a depression interview, PHQ-9, QIDS, or Hamilton depression.

## When not to use

- Not a medical device and not a depression diagnosis or treatment order.
- magent does not administer a depression interview. Each of the 12 printed items is a caller-assigned integer 0-5 (0 at no time through 5 all the time, last 2 weeks). magent does not interpret the items.
- This is Bech 2001 MDI only. Psychomotor is the maximum of restless and subdued; appetite is the maximum of reduced and increased appetite; the remaining eight items add as published. Total 0-50. magent does not score PHQ-9, QIDS, or Hamilton depression.
- Bech 2001 estimated an optimal total-score cutoff of 26 and treated the total as a sufficient statistic. magent returns at_or_above_cutoff (score ≥26) only. It does not apply Olsen 2003 HAM-D mapped mild/moderate/severe bands, and it does not apply DSM-IV or ICD-10 diagnostic algorithms from this paper.

## Formula

```
MDI = low_spirits + lost_interest + lack_of_energy + low_self_confidence + guilt + life_not_worth_living + concentration + max(restless, subdued) + sleep + max(reduced_appetite, increased_appetite); each caller-assigned 0-5; ten scored items; max 50; Bech 2001 optimal total-score cutoff 26
```

## Citation

[The sensitivity and specificity of the Major Depression Inventory, using the Present State Examination as the index of diagnostic validity](https://doi.org/10.1016/s0165-0327(00)00309-8)
Bech P, Rasmussen NA, Olsen LR, Noerholm V, Abildgaard W
J Affect Disord. 2001;66(2-3):159-164
DOI: [10.1016/s0165-0327(00)00309-8](https://doi.org/10.1016/s0165-0327(00)00309-8)

## Worked example

### All items 0

Given: `concentration=0, guilt=0, increased_appetite=0, lack_of_energy=0, life_not_worth_living=0, lost_interest=0, low_self_confidence=0, low_spirits=0, reduced_appetite=0, restless=0, sleep=0, subdued=0`

1. Each scored item is 0 (psychomotor max 0, appetite max 0, remaining items 0)
2. Score = 0 (max 50); at_or_above_cutoff false (Bech 2001 cutoff is 26)


### Appetite and psychomotor are the max of each pair

Given: `concentration=0, guilt=0, increased_appetite=1, lack_of_energy=0, life_not_worth_living=0, lost_interest=0, low_self_confidence=0, low_spirits=0, reduced_appetite=3, restless=2, sleep=0, subdued=5`

1. psychomotor = max(2, 5) = 5 (not 2+5); appetite = max(3, 1) = 3 (not 3+1)
2. Remaining items 0; score = 8; at_or_above_cutoff false


### Bech 2001 cutoff 26

Given: `concentration=0, guilt=5, increased_appetite=0, lack_of_energy=5, life_not_worth_living=1, lost_interest=5, low_self_confidence=5, low_spirits=5, reduced_appetite=0, restless=0, sleep=0, subdued=0`

1. 5 + 5 + 5 + 5 + 5 + 1 + 0 + max(0, 0) + 0 + max(0, 0) = 26
2. Score = 26 (max 50); at_or_above_cutoff true. No Olsen 2003 severity band.


## Also searched as

- MDI
- Major Depression Inventory
- Major Depression Index
- Bech MDI
- WHO MDI
- MDI score
- 10-item MDI
- Bech 2001 depression

## Parameters

- `low_spirits` (integer, required): Caller-assigned Bech 2001 MDI item 1 (integer 0-5): felt low in spirits or sad over the last 2 weeks (0 at no time, 1 some of the time, 2 slightly less than half of the time, 3 slightly more than half of the time, 4 most of the time, 5 all the time). Adds as published. magent does not interpret the item.
- `lost_interest` (integer, required): Caller-assigned Bech 2001 MDI item 2 (integer 0-5): lost interest in daily activities. Adds as published. magent does not interpret the item.
- `lack_of_energy` (integer, required): Caller-assigned Bech 2001 MDI item 3 (integer 0-5): lacking in energy and strength. Adds as published. magent does not interpret the item.
- `low_self_confidence` (integer, required): Caller-assigned Bech 2001 MDI item 4 (integer 0-5): felt less self-confident. Adds as published. magent does not interpret the item.
- `guilt` (integer, required): Caller-assigned Bech 2001 MDI item 5 (integer 0-5): bad conscience or feelings of guilt. Adds as published. magent does not interpret the item.
- `life_not_worth_living` (integer, required): Caller-assigned Bech 2001 MDI item 6 (integer 0-5): felt that life was not worth living. Adds as published. magent does not interpret the item.
- `concentration` (integer, required): Caller-assigned Bech 2001 MDI item 7 (integer 0-5): difficulty concentrating, for example when reading the newspaper or watching television. Adds as published. magent does not interpret the item.
- `restless` (integer, required): Caller-assigned Bech 2001 MDI item 8a (integer 0-5): felt very restless. The psychomotor item is the maximum of restless and subdued, not the sum. magent does not interpret the item.
- `subdued` (integer, required): Caller-assigned Bech 2001 MDI item 8b (integer 0-5): felt subdued or slowed down. The psychomotor item is the maximum of restless and subdued, not the sum. magent does not interpret the item.
- `sleep` (integer, required): Caller-assigned Bech 2001 MDI item 9 (integer 0-5): trouble sleeping at night. Adds as published. magent does not interpret the item.
- `reduced_appetite` (integer, required): Caller-assigned Bech 2001 MDI item 10a (integer 0-5): reduced appetite. The appetite item is the maximum of reduced_appetite and increased_appetite, not the sum. magent does not interpret the item.
- `increased_appetite` (integer, required): Caller-assigned Bech 2001 MDI item 10b (integer 0-5): increased appetite. The appetite item is the maximum of reduced_appetite and increased_appetite, not the sum. magent does not interpret the item.

## 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/mdi`
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",
      "guilt": "0",
      "increased_appetite": "0",
      "lack_of_energy": "0",
      "life_not_worth_living": "0",
      "lost_interest": "0",
      "low_self_confidence": "0",
      "low_spirits": "0",
      "reduced_appetite": "0",
      "restless": "0",
      "sleep": "0",
      "subdued": "0"
    },
    {
      "concentration": "0",
      "guilt": "0",
      "increased_appetite": "0",
      "lack_of_energy": "0",
      "life_not_worth_living": "0",
      "lost_interest": "0",
      "low_self_confidence": "0",
      "low_spirits": "0",
      "reduced_appetite": "0",
      "restless": "0",
      "sleep": "0",
      "subdued": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/mdi",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "low_spirits",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lost_interest",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lack_of_energy",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "low_self_confidence",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "guilt",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "life_not_worth_living",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "concentration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "psychomotor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sleep",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "appetite",
          "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": "Bech P, Rasmussen NA, Olsen LR, Noerholm V, Abildgaard W",
        "doi": "10.1016/s0165-0327(00)00309-8",
        "id": "bech-2001",
        "pmid": "11578668",
        "source": "J Affect Disord. 2001;66(2-3):159-164",
        "title": "The sensitivity and specificity of the Major Depression Inventory, using the Present State Examination as the index of diagnostic validity"
      },
      "formula": "mdi",
      "formula_expression": "MDI = low_spirits + lost_interest + lack_of_energy + low_self_confidence + guilt + life_not_worth_living + concentration + max(restless, subdued) + sleep + max(reduced_appetite, increased_appetite); each caller-assigned 0-5; ten scored items; max 50; Bech 2001 optimal total-score cutoff 26",
      "max_score": 50,
      "score": 0,
      "at_or_above_cutoff": false,
      "appetite_points": 0,
      "psychomotor_points": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "low_spirits",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lost_interest",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lack_of_energy",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "low_self_confidence",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "guilt",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "life_not_worth_living",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "concentration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "psychomotor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "sleep",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "appetite",
          "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": "Bech P, Rasmussen NA, Olsen LR, Noerholm V, Abildgaard W",
        "doi": "10.1016/s0165-0327(00)00309-8",
        "id": "bech-2001",
        "pmid": "11578668",
        "source": "J Affect Disord. 2001;66(2-3):159-164",
        "title": "The sensitivity and specificity of the Major Depression Inventory, using the Present State Examination as the index of diagnostic validity"
      },
      "formula": "mdi",
      "formula_expression": "MDI = low_spirits + lost_interest + lack_of_energy + low_self_confidence + guilt + life_not_worth_living + concentration + max(restless, subdued) + sleep + max(reduced_appetite, increased_appetite); each caller-assigned 0-5; ten scored items; max 50; Bech 2001 optimal total-score cutoff 26",
      "max_score": 50,
      "score": 0,
      "at_or_above_cutoff": false,
      "appetite_points": 0,
      "psychomotor_points": 0
    }
  ]
}
```

## Response fields

- `formula` (string): mdi
- `formula_expression` (string): Exact expression used
- `score` (integer): MDI points 0-50
- `max_score` (integer): 50
- `at_or_above_cutoff` (boolean): true iff score ≥ 26 (Bech 2001 optimal total-score cutoff). Not a diagnosis. Not Olsen 2003 HAM-D mapped mild/moderate/severe bands.
- `appetite_points` (integer): Appetite item 0-5: maximum of reduced_appetite and increased_appetite, not the sum
- `psychomotor_points` (integer): Psychomotor item 0-5: maximum of restless and subdued, not the sum
- `components` (array): Ten scored DSM-IV/ICD-10 symptom points
- `citation` (object): Bech et al. J Affect Disord 2001 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "low_spirits",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "lost_interest",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "lack_of_energy",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "low_self_confidence",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "guilt",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "life_not_worth_living",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "concentration",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "psychomotor",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "sleep",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "appetite",
      "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": "Bech P, Rasmussen NA, Olsen LR, Noerholm V, Abildgaard W",
    "doi": "10.1016/s0165-0327(00)00309-8",
    "id": "bech-2001",
    "pmid": "11578668",
    "source": "J Affect Disord. 2001;66(2-3):159-164",
    "title": "The sensitivity and specificity of the Major Depression Inventory, using the Present State Examination as the index of diagnostic validity"
  },
  "formula": "mdi",
  "formula_expression": "MDI = low_spirits + lost_interest + lack_of_energy + low_self_confidence + guilt + life_not_worth_living + concentration + max(restless, subdued) + sleep + max(reduced_appetite, increased_appetite); each caller-assigned 0-5; ten scored items; max 50; Bech 2001 optimal total-score cutoff 26",
  "max_score": 50,
  "score": 0,
  "at_or_above_cutoff": false,
  "appetite_points": 0,
  "psychomotor_points": 0
}
```

## Errors

- HTTP 400 `invalid_mdi`: Each Major Depression Inventory item must be an integer in the Bech 2001 published range. 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

- [PHQ-9](https://magentlab.com/docs/phq-9) — Sum nine caller-assigned Kroenke 2001 PHQ-9 integers (0-3) and return the published total (max 27), severity cutpoints, and ≥10 screen.
- [QIDS](https://magentlab.com/docs/qids) — Map 16 caller-assigned Rush 2003 QIDS-SR integers (0-3) to nine DSM-IV domains (sleep, appetite/weight, and psychomotor are each the published max of their items) and return the 0-27 total and IRT severity band.
- [GAD-7](https://magentlab.com/docs/gad-7) — Sum seven caller-assigned Spitzer 2006 GAD-7 integers (0-3) and return the published 0-21 total, 5/10/15 severity cuts, and ≥10 case-finding flag.

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