# MAGGIC Heart Failure Risk Score Calculator

> MAGGIC Heart Failure Risk Score 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-09-14).

Computes the Pocock 2013 MAGGIC integer risk score from 13 heart-failure predictors and returns 1-year and 3-year mortality probabilities from the published Table 4 lookup.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/maggic
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/maggic-heart-failure-risk-score-calculator-e6ce4cb5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_p7ii2EBS-0B5Y8A_JCA4M

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 maggic-heart-failure-risk-score-calculator-e6ce4cb5
```

Example prompt: Calculate the MAGGIC heart failure score for a 68-year-old male with an ejection fraction of 28%, NYHA class III, systolic BP 110 mmHg, BMI 27, creatinine 1.8 mg/dL, has diabetes, is not on a beta-blocker, is on an ACE inhibitor, HF duration over 18 months, non-smoker, no COPD — and give me the 1-year and 3-year mortality probabilities.

## When to prefer this

Use this endpoint when you need to compute the validated Pocock 2013 MAGGIC integer score specifically, including the published age×EF and SBP×EF interaction extras, and retrieve the official Table 4 mortality probability lookup — particularly for cardiology clinical decision support, HF risk stratification workflows, or mortality benchmarking where adherence to the published scoring algorithm matters.

## Known failure modes

- Missing required query parameters returns a validation error
- Out-of-range values (e.g. age <18 or >120, EF outside 1-90, BMI outside 10-80, NYHA outside 1-4) return an error
- Score outside the 0-50 Table 4 lookup range may return null probabilities
- Payment failure or missing x402 payment header results in 402 Payment Required
- Invalid enum value for sex (not 'male' or 'female') causes a 400 error

## How this service works

Pocock 2013 MAGGIC integer score from 13 heart-failure predictors (age, EF, NYHA, creatinine, diabetes, not prescribed beta-blocker, SBP, BMI, HF duration >18 months, current smoker, COPD, male sex, not prescribed ACEI/ARB), including the published age×EF and SBP×EF extras. Returns integer score and Table 4 1-year and 3-year death probabilities for scores 0-50. Not a diagnosis, not a treatment order, not a reason to withhold therapy. magent does not examine the patient.

## Output

Returns the computed MAGGIC integer score (0–50 range) and the published Table 4 1-year and 3-year mortality probability values corresponding to that score, based on the Pocock 2013 model including age×EF and SBP×EF interaction terms.

## 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": [
      "age",
      "ef_percent",
      "nyha_class",
      "diabetes",
      "beta_blocker",
      "systolic_mm_hg",
      "bmi_kg_m2",
      "hf_duration_gt_18_months",
      "current_smoker",
      "copd",
      "sex",
      "acei_arb"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (integer 18-120). Pocock 2013 integer extra depends on EF: <55 scores 0; then 55-59, 60-64, 65-69, 70-74, 75-79, >=80. magent does not examine the patient."
      },
      "sex": {
       "enum": [
        "female",
        "male"
       ],
       "type": "string",
       "description": "Sex (female or male). Male scores 1 (Figure 2)."
      },
      "copd": {
       "type": "boolean",
       "description": "COPD as assigned by the caller. true scores 2. magent does not diagnose COPD."
      },
      "acei_arb": {
       "type": "boolean",
       "description": "Prescribed an ACE inhibitor or ARB as assigned by the caller. true scores 0; false (not prescribed) scores 1. magent does not prescribe therapy."
      },
      "diabetes": {
       "type": "boolean",
       "description": "Diabetes as assigned by the caller. true scores 3 (Figure 2). magent does not diagnose diabetes."
      },
      "bmi_kg_m2": {
       "type": "number",
       "description": "Caller-supplied body-mass index in kg/m² (10-80). Figure 2: <15 6; 15-19 5; 20-24 3; 25-29 2; >=30 0. magent does not compute BMI from height and weight."
      },
      "ef_percent": {
       "type": "number",
       "description": "Left-ventricular ejection fraction in percent (1-90). Figure 2: <20 scores 7; 20-24 6; 25-29 5; 30-34 3; 35-39 2; >=40 0. Also selects the age and SBP extra rows. magent does not read an echocardiogram."
      },
      "nyha_class": {
       "type": "integer",
       "description": "NYHA class 1-4 as assigned by the caller (Figure 2: I 0, II 2, III 6, IV 8). magent does not as
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/maggic-heart-failure-risk-score-calculator-e6ce4cb5/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)
