# magent mGPS Calculator

> magent mGPS 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-10).

Computes the McMillan 2007 modified Glasgow Prognostic Score (mGPS 0–2) from serum CRP (mg/L) and albumin (g/L or g/dL)

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/mgps?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/magent-mgps-calculator-d747624e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cINfmVpLmg38Tdbvjnn6o

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 magent-mgps-calculator-d747624e
```

Example prompt: Calculate the modified Glasgow Prognostic Score (mGPS) for a patient with a CRP of 18 mg/L and serum albumin of 28 g/L using the McMillan 2007 formula.

## When to prefer this

Choose this endpoint when you need a deterministic, citable computation of the McMillan 2007 mGPS specifically — not the original GPS or hs-mGPS — from raw CRP (mg/L) and albumin lab values. Ideal for autonomous agents embedded in oncology workflows, clinical decision support pipelines, or research data enrichment where auditability (citation included in response) and formula transparency are required.

## Known failure modes

- Missing required crp_mg_l parameter returns an error
- CRP value outside 0–500 mg/L range may be rejected
- Providing both albumin_g_l and albumin_g_dl simultaneously is not allowed
- Non-numeric input for CRP or albumin causes a validation error
- albumin_g_dl outside 1–6 range or albumin_g_l outside 10–60 range may fail validation

## 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 with the mGPS score (0, 1, or 2), the formula expression used, the input CRP and albumin values, the full McMillan 2007 citation (DOI, PMID, authors, journal), and a disclaimer that this is not a medical device and a licensed clinician remains responsible for patient care.

## 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": [
      "crp_mg_l"
     ],
     "properties": {
      "crp_mg_l": {
       "type": "number",
       "description": "C-reactive protein in mg/L (0-500), not mg/dL. McMillan 2007 elevated CRP is >10 mg/L. CRP = 10 is not elevated and scores mGPS 0 regardless of albumin. magent does not assay CRP."
      },
      "albumin_g_l": {
       "type": "number",
       "description": "Serum albumin in g/L (10-60). Provide this or albumin_g_dl, not both. McMillan 2007 hypoalbuminaemia is <35 g/L (35 is not low). Ignored when CRP ≤ 10 mg/L. magent does not assay albumin."
      },
      "albumin_g_dl": {
       "type": "number",
       "description": "Serum albumin in g/dL (1-6). Converted as g/L = g/dL × 10. Provide this or albumin_g_l, not both."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/mgps",
  "count": 2,
  "items": [
   {
    "mgps": 0,
    "formula": "mgps",
    "citation": {
     "id": "mcmillan-2007",
     "doi": "10.1007/s00384-006-0259-6",
     "pmid": "17245566",
     "title": "Evaluation of an inflammation-based prognostic score (GPS) in patients undergoing resection for colon and rectal cancer",
     "source": "Int J Colorectal Dis. 2007;22(8):881-886",
     "authors": "McMillan DC, Crozier JEM, Canna K, Angerson WJ, McArdle CS"
    },
    "crp_mg_l": 5,
    "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.",
    "albumin_g_l": 40,
    "formula_expression": "mGPS 0: CRP ≤ 10 mg/L (albumin ignored); mGPS 1: CRP > 10 mg/L AND albumin ≥ 35 g/L; mGPS 2: CRP > 10 mg/L AND albumin < 35 g/L (McMillan 2007 modified GPS)"
   },
   {
    "mgps": 0,
    "formula": "mgps",
    "citation": {
     "id": "mcmillan-2007",
     "doi": "10.1007/s00384-006-0259-6",
     "pmid": "17245566",
     "title": "Evaluation of an inflammation-based prognostic score (GPS) in patients undergoing resection for colon and rectal cancer",
     "source": "Int J Colorectal Dis. 2007;22(8):881-886",
     "authors": "McMillan DC, Crozier JEM, Canna K, Angerson WJ, McArdle CS"
    },
    "crp_mg_l": 5,
    "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.",
    "albumin_g_l": 40,
    "formula_expression": "mGPS 0: CRP ≤ 10 mg/L (albumin ignored); mGPS 1: CRP > 10 mg/L AND albumin ≥ 35 g/L; mGPS 2: CRP > 10 mg/L AND albumin < 35 g/L (McMillan 2007 modified GPS)"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-mgps-calculator-d747624e/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)
