# Hamilton anxiety rating scale

HAM-A

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

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

## What it computes

Sum fourteen caller-assigned Hamilton 1959 HAM-A items (each integer 0-4) and return the published 0-56 total. Does not apply later total-score severity bands.

## When to use

When an agent already has Hamilton 1959 0-4 integers for the fourteen items and needs the published total. magent does not interview the patient, diagnose anxiety, or apply later 17/24 cutoffs.

## When not to use

- Not a medical device and not an anxiety diagnosis or treatment order.
- Each of the fourteen items is a caller-assigned integer 0-4 (0 not present, 1 mild, 2 moderate, 3 severe, 4 very severe). magent does not interview the patient.
- This is Hamilton 1959 HAM-A only (fourteen items; max 56). magent does not score GAD-7, PHQ-9, or Hamilton depression.
- Hamilton 1959 published no total-score severity bands. This tool returns score and max_score only. It does not apply later 17/24 website or review cutoffs.

## Formula

```
HAM-A = anxious_mood + tension + fears + insomnia + intellectual + depressed_mood + somatic_muscular + somatic_sensory + cardiovascular + respiratory + gastrointestinal + genitourinary + autonomic + interview_behavior; each caller-assigned 0-4; max 56; Hamilton 1959; no total-score severity bands
```

## Citation

[The assessment of anxiety states by rating](https://doi.org/10.1111/j.2044-8341.1959.tb00467.x)
Hamilton M
Br J Med Psychol. 1959;32(1):50-55
DOI: [10.1111/j.2044-8341.1959.tb00467.x](https://doi.org/10.1111/j.2044-8341.1959.tb00467.x)

## Worked example

### All items 0

Given: `anxious_mood=0, autonomic=0, cardiovascular=0, depressed_mood=0, fears=0, gastrointestinal=0, genitourinary=0, insomnia=0, intellectual=0, interview_behavior=0, respiratory=0, somatic_muscular=0, somatic_sensory=0, tension=0`

1. anxious_mood, tension, fears, insomnia, intellectual, depressed_mood, somatic_muscular, somatic_sensory, cardiovascular, respiratory, gastrointestinal, genitourinary, autonomic, and interview_behavior are 0 as assigned by the caller
2. Score = 0 (max 56). Hamilton 1959 published no total-score severity band.


### All items 4

Given: `anxious_mood=4, autonomic=4, cardiovascular=4, depressed_mood=4, fears=4, gastrointestinal=4, genitourinary=4, insomnia=4, intellectual=4, interview_behavior=4, respiratory=4, somatic_muscular=4, somatic_sensory=4, tension=4`

1. each of the fourteen Hamilton 1959 items is 4 as assigned by the caller
2. Score = 56 (max 56). No total-score severity band.


## Also searched as

- HAM-A
- Hamilton anxiety rating scale
- Hamilton Anxiety Scale
- HARS
- Hamilton 1959 anxiety
- HAM-A score
- 14-item Hamilton anxiety
- anxiety neurosis rating

## Parameters

- `anxious_mood` (integer, required): Caller-assigned Hamilton 1959 anxious mood (integer 0-4: 0 not present, 1 mild, 2 moderate, 3 severe, 4 very severe): worries, anticipation of the worst, fearful anticipation, irritability. magent does not interview the patient.
- `tension` (integer, required): Caller-assigned Hamilton 1959 tension (integer 0-4): feelings of tension, fatigability, startle response, moved to tears easily, trembling, restlessness, inability to relax. magent does not interview the patient.
- `fears` (integer, required): Caller-assigned Hamilton 1959 fears (integer 0-4): of dark, of strangers, of being left alone, of animals, of traffic, of crowds. magent does not interview the patient.
- `insomnia` (integer, required): Caller-assigned Hamilton 1959 insomnia (integer 0-4): difficulty falling asleep, broken sleep, unsatisfying sleep and fatigue on waking, dreams, nightmares, night terrors. magent does not interview the patient.
- `intellectual` (integer, required): Caller-assigned Hamilton 1959 intellectual / cognitive (integer 0-4): difficulty in concentration, poor memory. magent does not interview the patient.
- `depressed_mood` (integer, required): Caller-assigned Hamilton 1959 depressed mood (integer 0-4): loss of interest, lack of pleasure in hobbies, depression, early waking, diurnal swing. magent does not interview the patient.
- `somatic_muscular` (integer, required): Caller-assigned Hamilton 1959 somatic (muscular) (integer 0-4): pains and aches, twitching, stiffness, myoclonic jerks, grinding of teeth, unsteady voice, increased muscular tone. magent does not interview the patient.
- `somatic_sensory` (integer, required): Caller-assigned Hamilton 1959 somatic (sensory) (integer 0-4): tinnitus, blurring of vision, hot and cold flushes, feelings of weakness, pricking sensation. magent does not interview the patient.
- `cardiovascular` (integer, required): Caller-assigned Hamilton 1959 cardiovascular symptoms (integer 0-4): tachycardia, palpitations, pain in chest, throbbing of vessels, fainting feelings, missing beat. magent does not interview the patient.
- `respiratory` (integer, required): Caller-assigned Hamilton 1959 respiratory symptoms (integer 0-4): pressure or constriction in chest, choking feelings, sighing, dyspnea. magent does not interview the patient.
- `gastrointestinal` (integer, required): Caller-assigned Hamilton 1959 gastro-intestinal symptoms (integer 0-4): difficulty in swallowing, wind, abdominal pain, burning sensations, abdominal fullness, nausea, vomiting, borborygmi, looseness of bowels, loss of weight, constipation. magent does not interview the patient.
- `genitourinary` (integer, required): Caller-assigned Hamilton 1959 genito-urinary symptoms (integer 0-4): frequency or urgency of micturition, amenorrhea, menorrhagia, development of frigidity, premature ejaculation, loss of libido, impotence. magent does not interview the patient.
- `autonomic` (integer, required): Caller-assigned Hamilton 1959 autonomic symptoms (integer 0-4): dry mouth, flushing, pallor, tendency to sweat, giddiness, tension headache, raising of hair. magent does not interview the patient.
- `interview_behavior` (integer, required): Caller-assigned Hamilton 1959 behaviour at interview (integer 0-4): fidgeting, restlessness or pacing, tremor of hands, furrowed brow, strained face, sighing or rapid respiration, facial pallor, swallowing. 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/hamilton_anxiety`
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": [
    {
      "anxious_mood": "0",
      "autonomic": "0",
      "cardiovascular": "0",
      "depressed_mood": "0",
      "fears": "0",
      "gastrointestinal": "0",
      "genitourinary": "0",
      "insomnia": "0",
      "intellectual": "0",
      "interview_behavior": "0",
      "respiratory": "0",
      "somatic_muscular": "0",
      "somatic_sensory": "0",
      "tension": "0"
    },
    {
      "anxious_mood": "0",
      "autonomic": "0",
      "cardiovascular": "0",
      "depressed_mood": "0",
      "fears": "0",
      "gastrointestinal": "0",
      "genitourinary": "0",
      "insomnia": "0",
      "intellectual": "0",
      "interview_behavior": "0",
      "respiratory": "0",
      "somatic_muscular": "0",
      "somatic_sensory": "0",
      "tension": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/hamilton_anxiety",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "anxious_mood",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tension",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "fears",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "insomnia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "intellectual",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "depressed_mood",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "somatic_muscular",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "somatic_sensory",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "cardiovascular",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "respiratory",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gastrointestinal",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "genitourinary",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "autonomic",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "interview_behavior",
          "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": "Hamilton M",
        "doi": "10.1111/j.2044-8341.1959.tb00467.x",
        "id": "hamilton-1959",
        "pmid": "13638508",
        "source": "Br J Med Psychol. 1959;32(1):50-55",
        "title": "The assessment of anxiety states by rating"
      },
      "formula": "hamilton_anxiety",
      "formula_expression": "HAM-A = anxious_mood + tension + fears + insomnia + intellectual + depressed_mood + somatic_muscular + somatic_sensory + cardiovascular + respiratory + gastrointestinal + genitourinary + autonomic + interview_behavior; each caller-assigned 0-4; max 56; Hamilton 1959; no total-score severity bands",
      "max_score": 56,
      "score": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "anxious_mood",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tension",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "fears",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "insomnia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "intellectual",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "depressed_mood",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "somatic_muscular",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "somatic_sensory",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "cardiovascular",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "respiratory",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "gastrointestinal",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "genitourinary",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "autonomic",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "interview_behavior",
          "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": "Hamilton M",
        "doi": "10.1111/j.2044-8341.1959.tb00467.x",
        "id": "hamilton-1959",
        "pmid": "13638508",
        "source": "Br J Med Psychol. 1959;32(1):50-55",
        "title": "The assessment of anxiety states by rating"
      },
      "formula": "hamilton_anxiety",
      "formula_expression": "HAM-A = anxious_mood + tension + fears + insomnia + intellectual + depressed_mood + somatic_muscular + somatic_sensory + cardiovascular + respiratory + gastrointestinal + genitourinary + autonomic + interview_behavior; each caller-assigned 0-4; max 56; Hamilton 1959; no total-score severity bands",
      "max_score": 56,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): hamilton_anxiety
- `formula_expression` (string): Exact expression used
- `score` (integer): Hamilton 1959 HAM-A sum of fourteen caller-assigned 0-4 items (0-56)
- `max_score` (integer): Always 56
- `components` (array): Per-item caller-assigned points
- `citation` (object): Hamilton Br J Med Psychol 1959 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "anxious_mood",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "tension",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "fears",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "insomnia",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "intellectual",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "depressed_mood",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "somatic_muscular",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "somatic_sensory",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "cardiovascular",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "respiratory",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "gastrointestinal",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "genitourinary",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "autonomic",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "interview_behavior",
      "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": "Hamilton M",
    "doi": "10.1111/j.2044-8341.1959.tb00467.x",
    "id": "hamilton-1959",
    "pmid": "13638508",
    "source": "Br J Med Psychol. 1959;32(1):50-55",
    "title": "The assessment of anxiety states by rating"
  },
  "formula": "hamilton_anxiety",
  "formula_expression": "HAM-A = anxious_mood + tension + fears + insomnia + intellectual + depressed_mood + somatic_muscular + somatic_sensory + cardiovascular + respiratory + gastrointestinal + genitourinary + autonomic + interview_behavior; each caller-assigned 0-4; max 56; Hamilton 1959; no total-score severity bands",
  "max_score": 56,
  "score": 0
}
```

## Errors

- HTTP 400 `invalid_hamilton_anxiety`: Each Hamilton 1959 anxiety item must be an integer 0–4 as published. 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

- [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.
- [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.
- [CIWA-Ar](https://magentlab.com/docs/ciwa-ar) — Sum the ten Sullivan 1989 CIWA-Ar items (nine caller-assigned 0-7 plus orientation 0-4) and return the published total (max 67).

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