# Charlson Comorbidity Index (CCI) Calculator

> Charlson Comorbidity Index (CCI) Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Computes the Charlson 1987 original weighted comorbidity index score from 19 caller-supplied clinical flags, returning a total score (0–37) and 1-year mortality band.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/charlson?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/charlson-comorbidity-index-cci-calculator-f6b065ea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zzjQTAa-3Grahu2Q4lnPo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability charlson-comorbidity-index-cci-calculator-f6b065ea
```

Example prompt: Compute the original Charlson Comorbidity Index for a patient who has myocardial infarction, congestive heart failure, diabetes with end-organ damage, and metastatic solid tumor — all other conditions are absent.

## When to prefer this

Use this endpoint when you need the exact original Charlson 1987 weighted CCI (not Deyo ICD-9, Quan ICD-10, or age-adjusted variants). It is specifically suited for agentic pipelines that require the raw integer CCI to feed downstream tools like the LACE index, or for longitudinal research scoring where the 1987 published formula must be cited verbatim. Each of the 19 flags must be independently assigned by the caller — the API does not perform ICD code mapping or diagnosis.

## Known failure modes

- Missing any of the 19 required boolean query parameters returns a validation error
- Non-boolean values for flags cause a schema error
- Payment not included or insufficient USDC results in 402 Payment Required
- Network timeout if the service is temporarily unavailable
- Score is 0 if all flags are false — not an error, but caller should verify inputs

## How this service works

Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.

## Output

Returns a JSON object containing the total CCI integer score (0–37), the Charlson mortality band (score_0, score_1_2, score_3_4, score_5_plus), a breakdown of each of the 19 comorbidity factors with their individual point contribution, the formula expression used, max possible score, and the original Charlson 1987 citation with DOI and PMID. A disclaimer notes this is not a medical device.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "myocardial_infarction",
      "congestive_heart_failure",
      "peripheral_vascular_disease",
      "cerebrovascular_disease",
      "dementia",
      "chronic_pulmonary_disease",
      "connective_tissue_disease",
      "peptic_ulcer_disease",
      "mild_liver_disease",
      "diabetes",
      "hemiplegia",
      "moderate_severe_renal_disease",
      "diabetes_end_organ",
      "any_tumor",
      "leukemia",
      "lymphoma",
      "moderate_severe_liver_disease",
      "metastatic_solid_tumor",
      "aids"
     ],
     "properties": {
      "aids": {
       "type": "boolean",
       "description": "AIDS as assigned by the caller (Charlson 1987). true scores 6. magent does not diagnose AIDS."
      },
      "dementia": {
       "type": "boolean",
       "description": "Dementia as assigned by the caller (Charlson 1987). true scores 1. magent does not diagnose dementia."
      },
      "diabetes": {
       "type": "boolean",
       "description": "Diabetes without end-organ damage as assigned by the caller (Charlson 1987). true scores 1. Independent of diabetes_end_organ. magent does not diagnose diabetes."
      },
      "leukemia": {
       "type": "boolean",
       "description": "Leukemia as assigned by the caller (Charlson 1987). true scores 2. magent does not diagnose leukemia."
      },
      "lymphoma": {
       "type": "boolean",
       "description": "Lymphoma as assigned by the caller (Charlson 1987). true scores 2. magent does not diagnose lymphoma."
      },
      "any_tumor": {
       "type": "boolean",
       "description": "Any tumor (solid tumor without metastasis) as assigned by the caller (Charlson 1987). true scores 2. Independent of metastatic_solid_tumor. magent does not diagnose cancer."
      },
      "hemiplegia": {
       "type": "boolean",
       "description": "Hemiplegia as assigned by the caller (Charlson 1987). true scores 2. magent does not diagnose h
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/charlson",
  "count": 2,
  "items": [
   {
    "score": 0,
    "formula": "charlson",
    "citation": {
     "id": "charlson-1987",
     "doi": "10.1016/0021-9681(87)90171-8",
     "pmid": "3558716",
     "title": "A new method of classifying prognostic comorbidity in longitudinal studies: development and validation",
     "source": "J Chronic Dis. 1987;40(5):373-383",
     "authors": "Charlson ME, Pompei P, Ales KL, MacKenzie CR"
    },
    "max_score": 37,
    "components": [
     {
      "factor": "myocardial_infarction",
      "points": 0,
      "present": false
     },
     {
      "factor": "congestive_heart_failure",
      "points": 0,
      "present": false
     },
     {
      "factor": "peripheral_vascular_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "cerebrovascular_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "dementia",
      "points": 0,
      "present": false
     },
     {
      "factor": "chronic_pulmonary_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "connective_tissue_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "peptic_ulcer_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "mild_liver_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "diabetes",
      "points": 0,
      "present": false
     },
     {
      "factor": "hemiplegia",
      "points": 0,
      "present": false
     },
     {
      "factor": "moderate_severe_renal_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "diabetes_end_organ",
      "points": 0,
      "present": false
     },
     {
      "factor": "any_tumor",
      "points": 0,
      "present": false
     },
     {
      "factor": "leukemia",
      "points": 0,
      "present": false
     },
     {
      "factor": "lymphoma",
      "points": 0,
      "present": false
     },
     {
      "factor": "moderate_severe_liver_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "metastatic_solid_tumor",
      "points": 0,
      "present": false
     },
     {
      "factor": "aids",
      "points": 0,
      "present": false
     }
    ],
    "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsi
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/charlson-comorbidity-index-cci-calculator-f6b065ea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
