# Rockall Score Calculator (Post-Endoscopy, 1996)

> Rockall Score Calculator (Post-Endoscopy, 1996) 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-15).

Computes the complete post-endoscopy Rockall score for risk-stratifying acute upper GI haemorrhage patients, returning a score from 0 to 11.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/rockall
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rockall-score-calculator-post-endoscopy-1996-c9058abf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QYtk8y4fv1_08MW8k0H3n

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 rockall-score-calculator-post-endoscopy-1996-c9058abf
```

Example prompt: Calculate the complete post-endoscopy Rockall score for a 72-year-old patient with heart rate 105 bpm and systolic BP 110 mmHg, no comorbidities, diagnosed with peptic ulcer (other), and stigmata showing an adherent clot (blood_clot_vessel).

## When to prefer this

Use this endpoint when you need the complete (post-endoscopy) 1996 Rockall score specifically — not the pre-endoscopy-only Rockall variant, AIMS65, or Glasgow-Blatchford Score (GBS). It is the correct tool when endoscopic findings (diagnosis and stigmata) are available. Caller must supply comorbidity, diagnosis, and stigmata categories based on clinical assessment, as the API does not infer these from raw clinical notes.

## Known failure modes

- Missing required parameters (age, heart_rate_bpm, systolic_mm_hg, comorbidity, diagnosis, stigmata) returns a 400 error
- Invalid enum value for comorbidity, diagnosis, or stigmata returns a validation error
- Age or heart rate outside allowed range (age 18–120, HR 30–220) returns a validation error
- Systolic BP outside 50–250 mmHg returns a validation error
- Payment failure via x402 protocol returns 402 Payment Required

## How this service works

Rockall 1996 complete (post-endoscopy) score after acute upper GI haemorrhage: age <60 0, 60-79 1, >=80 2; shock SBP<100 2 (hypotension; tachycardia not added), else HR>=100 1, else 0; comorbidity none 0, cardiac 2, renal/liver/metastatic 3; diagnosis none or mallory_weiss 0, other 1, malignancy 2; stigmata none_or_spot 0, blood_clot_vessel 2. Max 11. Not pre-endoscopy-only Rockall, AIMS65, or GBS. Caller assigns comorbidity, diagnosis, and stigmata.

## Output

Returns the integer total Rockall score (0–11) derived from the five post-endoscopy components: age band (0–2), shock status (0–2), comorbidity (0–3), endoscopic diagnosis (0–2), and stigmata of recent haemorrhage (0–2). Higher scores indicate greater risk of rebleeding and mortality.

## 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",
      "heart_rate_bpm",
      "systolic_mm_hg",
      "comorbidity",
      "diagnosis",
      "stigmata"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). <60 scores 0; 60-79 scores 1; ≥80 scores 2. 59 does not score; 60 scores 1; 79 scores 1; 80 scores 2."
      },
      "stigmata": {
       "type": "string",
       "description": "Caller-assigned stigmata of recent haemorrhage: none_or_spot (0; none or dark spot only) or blood_clot_vessel (2; blood in the upper GI tract, adherent clot, visible or spurting vessel). magent does not assign stigmata."
      },
      "diagnosis": {
       "type": "string",
       "description": "Caller-assigned diagnosis: none (0; no lesion identified and no stigmata of recent haemorrhage), mallory_weiss (0), other (1; all other diagnoses), or malignancy (2; malignancy of the upper GI tract). magent does not assign diagnosis."
      },
      "comorbidity": {
       "type": "string",
       "description": "Caller-assigned comorbidity: none (0), cardiac (2; cardiac failure, IHD, or any major comorbidity), or renal_liver_metastatic (3; renal failure, liver failure, or disseminated malignancy). magent does not assign comorbidity."
      },
      "heart_rate_bpm": {
       "type": "integer",
       "description": "Heart rate in beats per minute (integer 30-220). With SBP ≥100, HR ≥100 scores 1 (tachycardia); 99 does not. Not added when SBP <100."
      },
      "systolic_mm_hg": {
       "type": "number",
       "description": "Systolic blood pressure in mm Hg (50-250). SBP <100 scores 2 (hypotension) and tachycardia is not added; 100 does not score hypotension."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "obje
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/rockall",
  "count": 2,
  "items": [
   {
    "score": 0,
    "formula": "rockall",
    "citation": {
     "id": "rockall-1996",
     "doi": "10.1136/gut.38.3.316",
     "pmid": "8675081",
     "title": "Risk assessment after acute upper gastrointestinal haemorrhage",
     "source": "Gut. 1996;38(3):316-321",
     "authors": "Rockall TA, Logan RF, Devlin HB, Northfield TC"
    },
    "stigmata": "none_or_spot",
    "age_years": 50,
    "diagnosis": "none",
    "max_score": 11,
    "components": [
     {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": false
     },
     {
      "value": {
       "heart_rate_bpm": 80,
       "systolic_mm_hg": 120
      },
      "factor": "shock",
      "points": 0,
      "present": false
     },
     {
      "value": "none",
      "factor": "comorbidity",
      "points": 0,
      "present": false
     },
     {
      "value": "none",
      "factor": "diagnosis",
      "points": 0,
      "present": false
     },
     {
      "value": "none_or_spot",
      "factor": "stigmata",
      "points": 0,
      "present": false
     }
    ],
    "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.",
    "comorbidity": "none",
    "heart_rate_bpm": 80,
    "systolic_mm_hg": 120,
    "formula_expression": "Rockall = age (<60: 0, 60-79: 1, >=80: 2) + shock (SBP<100: 2; else HR>=100: 1; else 0) + comorbidity (none: 0, cardiac: 2, renal_liver_metastatic: 3) + diagnosis (none: 0, mallory_weiss: 0, other: 1, malignancy: 2) + stigmata (none_or_spot: 0, blood_clot_vessel: 2); max 11"
   },
   {
    "score": 0,
    "formula": "rockall",
    "citation": {
     "id": "rockall-1996",
     "doi": "10.1136/gut.38.3.316",
     "pmid": "8675081",
     "title": "Risk assessment after acute upper gastrointestinal haemorrhage",
     "source": "Gut. 1996;38(3):316-321",
     "authors": "Rockall TA, Logan RF, Devlin HB, Northfield TC"
    },
    "stigmata": "none_or_spot",
    "age_years": 50,
    "diagnosis": "none",
    "max_score": 11,
    "components": [
     {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": false
     },
     {
      "value": {
       "heart_rate_bpm": 80,
       "systolic_mm_hg": 120
      },
      "factor": "shock",
      "points": 0,
      "present": false
     },
     {
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rockall-score-calculator-post-endoscopy-1996-c9058abf/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)
