# Glasgow-Blatchford Score (GBS) Calculator

> Glasgow-Blatchford Score (GBS) 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-15).

Computes the Glasgow-Blatchford Score for predicting need for clinical intervention after upper gastrointestinal haemorrhage, using urea, haemoglobin, blood pressure, heart rate, and comorbidities.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/glasgow_blatchford
- 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/glasgow-blatchford-score-gbs-calculator-e752b147
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_36gggTuRtuQv6b2pSumtt

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 glasgow-blatchford-score-gbs-calculator-e752b147
```

Example prompt: Calculate the Glasgow-Blatchford Score for a male patient with a BUN of 22 mg/dL, hemoglobin of 11.5 g/dL, systolic BP of 95 mmHg, heart rate of 102 bpm, melena present, no syncope, no hepatic disease, and no cardiac failure — tell me if he's low risk.

## When to prefer this

Use this endpoint when you need a validated, published GBS per Blatchford 2000 specifically — not Rockall score, not AIMS65, and not a proprietary risk model. Ideal for clinical decision support agents triaging upper GI haemorrhage, automated EHR scoring workflows, or audit systems checking whether a patient meets the GBS=0 low-risk threshold for safe outpatient discharge. Supports both mmol/L and mg/dL urea, and both g/L and g/dL haemoglobin, making it flexible for US and international clinical contexts.

## Known failure modes

- Missing required parameters (sex, systolic_mm_hg, heart_rate_bpm, melena, syncope, hepatic_disease, cardiac_failure) returns a validation error
- Providing both urea_mmol_l and bun_mg_dl simultaneously causes a conflict error
- Providing both hemoglobin_g_l and hemoglobin_g_dl simultaneously causes a conflict error
- Out-of-range values (e.g. heart rate <30 or >220) are rejected
- Invalid sex value (not 'male' or 'female') returns a parameter error
- Payment failure (insufficient USDC balance or x402 not configured) blocks the request

## How this service works

Glasgow-Blatchford score (Blatchford 2000) for need for treatment after upper-gastrointestinal haemorrhage. Points from urea, haemoglobin (sex-specific), systolic BP, heart rate ≥100, melena, syncope, hepatic disease, and cardiac failure; max 23. Score 0 is the published low-risk screen; magent does not invent other GBS bands. Not a diagnosis, not Rockall, and not AIMS65. Urea may be mmol/L or BUN mg/dL; haemoglobin g/L or g/dL.

## Output

Returns the integer Glasgow-Blatchford Score (0–23), with each variable's point contribution mapped according to the Blatchford 2000 published table. A score of 0 corresponds to the validated low-risk threshold (safe for outpatient management); higher scores indicate increasing need for clinical intervention. The endpoint does not output Rockall or AIMS65 scores and does not invent additional GBS risk bands beyond the published criteria.

## 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": [
      "sex",
      "systolic_mm_hg",
      "heart_rate_bpm",
      "melena",
      "syncope",
      "hepatic_disease",
      "cardiac_failure"
     ],
     "properties": {
      "sex": {
       "type": "string",
       "description": "Sex (female or male). Haemoglobin points use the Blatchford 2000 sex-specific table."
      },
      "melena": {
       "type": "boolean",
       "description": "Melena as assigned by the caller. true or false. 1 point if true."
      },
      "syncope": {
       "type": "boolean",
       "description": "Syncope as assigned by the caller. true or false. 2 points if true."
      },
      "bun_mg_dl": {
       "type": "number",
       "description": "BUN in mg/dL (3-140). Converted as urea_mmol_l = bun_mg_dl / 2.8. Provide this or urea_mmol_l, not both."
      },
      "urea_mmol_l": {
       "type": "number",
       "description": "Blood urea in mmol/L (1-50). Provide this or bun_mg_dl, not both. <6.5 scores 0; 6.5–7.9 scores 2; 8.0–9.9 scores 3; 10.0–24.9 scores 4; ≥25.0 scores 6."
      },
      "heart_rate_bpm": {
       "type": "integer",
       "description": "Heart rate in beats per minute (integer 30-220). Scores 1 when ≥100; 99 does not score."
      },
      "hemoglobin_g_l": {
       "type": "number",
       "description": "Haemoglobin in g/L (30-220). Provide this or hemoglobin_g_dl, not both. Men: <100 → 6; 100–119 → 3; 120–129 → 1; ≥130 → 0. Women: <100 → 6; 100–119 → 1; ≥120 → 0."
      },
      "systolic_mm_hg": {
       "type": "number",
       "description": "Systolic blood pressure in mm Hg (50-250). <90 scores 3; 90–99 scores 2; 100–109 scores 1; ≥110 scores 0."
      },
      "cardiac_failure": {
       "type": "boolean",
       "description": "Cardiac failure as assigned by the caller. true or false. 2 points if true."
      },
      "hemoglobin_g_dl": {
       "type": "number",
       "description": "Haemoglobin in g/dL (3-22). Converted as h
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/glasgow_blatchford",
  "count": 2,
  "items": [
   {
    "sex": "male",
    "score": 0,
    "formula": "glasgow_blatchford",
    "citation": {
     "id": "blatchford-2000",
     "doi": "10.1016/S0140-6736(00)02816-6",
     "title": "A risk score to predict need for treatment for upper-gastrointestinal haemorrhage",
     "source": "Lancet. 2000;356(9238):1318-1321",
     "authors": "Blatchford O, Murray WR, Blatchford M"
    },
    "gbs_risk": "low",
    "max_score": 23,
    "components": [
     {
      "value": 5,
      "factor": "urea",
      "points": 0,
      "present": false
     },
     {
      "value": 140,
      "factor": "hemoglobin",
      "points": 0,
      "present": false
     },
     {
      "value": 120,
      "factor": "systolic",
      "points": 0,
      "present": false
     },
     {
      "value": 80,
      "factor": "heart_rate",
      "points": 0,
      "present": false
     },
     {
      "factor": "melena",
      "points": 0,
      "present": false
     },
     {
      "factor": "syncope",
      "points": 0,
      "present": false
     },
     {
      "factor": "hepatic_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "cardiac_failure",
      "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.",
    "urea_mmol_l": 5,
    "heart_rate_bpm": 80,
    "hemoglobin_g_l": 140,
    "systolic_mm_hg": 120,
    "formula_expression": "GBS = urea_mmol_l table + haemoglobin_g_l table (sex-specific) + systolic_mm_hg table + (heart_rate_bpm >= 100) + melena + 2*syncope + 2*hepatic_disease + 2*cardiac_failure; max 23; score 0 low, else not_low"
   },
   {
    "sex": "male",
    "score": 0,
    "formula": "glasgow_blatchford",
    "citation": {
     "id": "blatchford-2000",
     "doi": "10.1016/S0140-6736(00)02816-6",
     "title": "A risk score to predict need for treatment for upper-gastrointestinal haemorrhage",
     "source": "Lancet. 2000;356(9238):1318-1321",
     "authors": "Blatchford O, Murray WR, Blatchford M"
    },
    "gbs_risk": "low",
    "max_score": 23,
    "components": [
     {
      "value": 5,
      "factor": "urea",
      "points": 0,
      "present": false
     },
     {
      "value": 140,
      "factor": "hemoglobin",
      "points": 0,
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/glasgow-blatchford-score-gbs-calculator-e752b147/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)
