MAGENT

GI · LIVE

TG18 acute cholangitis

Tokyo cholangitis

Apply Kiriyama 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholangitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags and age.

LIVE $0.005 USDC GET /api/calc/tokyo_cholangitis

Markdown: /docs/tokyo-cholangitis.md · Canonical: https://magentlab.com/docs/tokyo-cholangitis

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Apply Kiriyama 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholangitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags and age.

When to use

When an agent already has caller-assigned systemic inflammation, cholestasis, imaging, organ-dysfunction, and Grade II flags plus age and needs the published TG18 (=TG13) cholangitis classification. magent does not examine the patient, assay labs, or read imaging. Not TG18 cholecystitis. Not Alvarado or RIPASA.

When not to use

  • Not a medical device and not a diagnosis of acute cholangitis that replaces imaging or laboratory review.
  • TG18 diagnostic criteria and severity grading of acute cholangitis are unchanged from TG13 (Kiriyama 2018).
  • This tool is acute cholangitis only. It is not TG18 acute cholecystitis and not Alvarado or RIPASA (appendicitis scores).
  • magent does not examine the patient, assay labs, or read imaging. The caller assigns every flag, including whether albumin is <0.7× the local lower limit of normal.
  • Not a biliary-drainage order. Severity is none when diagnosis is none. Grade III beats Grade II. Grade II requires any two items, not any one (that any-one rule is TG18 cholecystitis).

Formula

definite iff one A (fever_or_chills or elevated_wbc_or_crp) and one B (jaundice or abnormal_lfts) and one C (biliary_dilatation or etiology_on_imaging); suspected iff one A and one item in either B or C (not all three); else none. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any two Grade II items (wbc_gt_12k_or_lt_4k, fever_ge_39, age>=75, bilirubin_ge_5, hypoalbuminemia), else grade_i. When diagnosis is none, severity is none (Kiriyama 2018 TG18 = TG13 unmodified)

Citation

Title
Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholangitis (with videos).
Authors
Kiriyama S, Kozaka K, Takada T, et al.
Source
J Hepatobiliary Pancreat Sci. 2018;25(1):17-30
DOI
10.1002/jhbp.512

Worked example

No systemic, cholestasis, or imaging findings

Given: abnormal_lfts=falseage=60biliary_dilatation=falsebilirubin_ge_5=falsedecreased_consciousness=falseelevated_wbc_or_crp=falseetiology_on_imaging=falsefever_ge_39=falsefever_or_chills=falsehypoalbuminemia=falsehypotension_vasopressors=falsejaundice=falseoliguria_or_creatinine_gt_2=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falsewbc_gt_12k_or_lt_4k=false

  1. systemic_inflammation, cholestasis, and imaging are all false; age is 60
  2. diagnosis is none; severity is none (Grade I is not reported without cholangitis)

Fever/chills and jaundice without imaging is suspected Grade I

Given: abnormal_lfts=falseage=60biliary_dilatation=falsebilirubin_ge_5=falsedecreased_consciousness=falseelevated_wbc_or_crp=falseetiology_on_imaging=falsefever_ge_39=falsefever_or_chills=truehypoalbuminemia=falsehypotension_vasopressors=falsejaundice=trueoliguria_or_creatinine_gt_2=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falsewbc_gt_12k_or_lt_4k=false

  1. one A and one B hold; imaging is false (Kiriyama 2018 suspected = A + either B or C)
  2. diagnosis is suspected; fewer than two Grade II items and no Grade III flag, so severity is grade_i

Fever/chills and biliary dilatation without cholestasis is suspected Grade I

Given: abnormal_lfts=falseage=60biliary_dilatation=truebilirubin_ge_5=falsedecreased_consciousness=falseelevated_wbc_or_crp=falseetiology_on_imaging=falsefever_ge_39=falsefever_or_chills=truehypoalbuminemia=falsehypotension_vasopressors=falsejaundice=falseoliguria_or_creatinine_gt_2=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falsewbc_gt_12k_or_lt_4k=false

  1. one A and one C hold; cholestasis is false (Kiriyama 2018 suspected = A + either B or C)
  2. diagnosis is suspected; fewer than two Grade II items and no Grade III flag, so severity is grade_i

One Grade II item is still Grade I (not cholecystitis)

Given: abnormal_lfts=falseage=60biliary_dilatation=truebilirubin_ge_5=falsedecreased_consciousness=falseelevated_wbc_or_crp=falseetiology_on_imaging=falsefever_ge_39=falsefever_or_chills=truehypoalbuminemia=falsehypotension_vasopressors=falsejaundice=trueoliguria_or_creatinine_gt_2=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falsewbc_gt_12k_or_lt_4k=true

  1. one A, one B, and one C hold, so diagnosis is definite
  2. exactly one Grade II item is not enough; TG18 cholangitis Grade II needs any two, so severity is grade_i

Also searched as

  • Tokyo Guidelines 2018 cholangitis
  • TG18 acute cholangitis
  • TG13 cholangitis
  • Kiriyama 2018
  • acute cholangitis diagnostic criteria
  • Tokyo cholangitis severity grade
  • TG18 Grade III cholangitis
  • TG18 Grade II any two

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/tokyo_cholangitis?age=60&fever_or_chills=false&elevated_wbc_or_crp=false&jaundice=false&abnormal_lfts=false&biliary_dilatation=false&etiology_on_imaging=false&hypotension_vasopressors=false&decreased_consciousness=false&pfr_lt_300=false&oliguria_or_creatinine_gt_2=false&pt_inr_gt_1_5=false&platelets_lt_100k=false&wbc_gt_12k_or_lt_4k=false&fever_ge_39=false&bilirubin_ge_5=false&hypoalbuminemia=false

Full URL: https://api.magentlab.com/api/calc/tokyo_cholangitis?age=60&fever_or_chills=false&elevated_wbc_or_crp=false&jaundice=false&abnormal_lfts=false&biliary_dilatation=false&etiology_on_imaging=false&hypotension_vasopressors=false&decreased_consciousness=false&pfr_lt_300=false&oliguria_or_creatinine_gt_2=false&pt_inr_gt_1_5=false&platelets_lt_100k=false&wbc_gt_12k_or_lt_4k=false&fever_ge_39=false&bilirubin_ge_5=false&hypoalbuminemia=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/tokyo_cholangitis?age=60&fever_or_chills=false&elevated_wbc_or_crp=false&jaundice=false&abnormal_lfts=false&biliary_dilatation=false&etiology_on_imaging=false&hypotension_vasopressors=false&decreased_consciousness=false&pfr_lt_300=false&oliguria_or_creatinine_gt_2=false&pt_inr_gt_1_5=false&platelets_lt_100k=false&wbc_gt_12k_or_lt_4k=false&fever_ge_39=false&bilirubin_ge_5=false&hypoalbuminemia=false"

Parameters

Name Type Required Description
age integer required Age in years (18-120). Counts as one Kiriyama 2018 TG18 Grade II item when age ≥75. Age 75 meets; age 74 does not. magent does not examine the patient.
fever_or_chills boolean required Fever and/or shaking chills as assigned by the caller (Kiriyama 2018 TG18 A-1). true or false. magent does not measure temperature or examine the patient.
elevated_wbc_or_crp boolean required Laboratory inflammatory response (elevated WBC or CRP) as assigned by the caller (Kiriyama 2018 TG18 A-2). true or false. magent does not assay WBC or CRP.
jaundice boolean required Jaundice as assigned by the caller (Kiriyama 2018 TG18 B-1). true or false. magent does not examine the patient.
abnormal_lfts boolean required Increased ALP, GGT, AST, or ALT as assigned by the caller (Kiriyama 2018 TG18 B-2). true or false. magent does not assay liver tests.
biliary_dilatation boolean required Biliary dilatation as assigned by the caller (Kiriyama 2018 TG18 C-1). true or false. magent does not read imaging.
etiology_on_imaging boolean required Evidence of etiology on imaging (stricture, stone, stent, or equivalent) as assigned by the caller (Kiriyama 2018 TG18 C-2). true or false. magent does not read imaging.
hypotension_vasopressors boolean required Hypotension requiring dopamine ≥5 µg/kg/min or any norepinephrine as assigned by the caller (Kiriyama 2018 TG18 Grade III cardiovascular dysfunction). true or false. magent does not measure blood pressure or order vasopressors.
decreased_consciousness boolean required Decreased level of consciousness as assigned by the caller (Kiriyama 2018 TG18 Grade III neurological dysfunction). true or false. magent does not examine the patient.
pfr_lt_300 boolean required PaO2/FiO2 <300 as assigned by the caller (Kiriyama 2018 TG18 Grade III respiratory dysfunction). true or false. magent does not interpret blood gas or ventilator settings.
oliguria_or_creatinine_gt_2 boolean required Oliguria or creatinine >2.0 mg/dL as assigned by the caller (Kiriyama 2018 TG18 Grade III renal dysfunction). true or false. magent does not assay creatinine or measure urine output.
pt_inr_gt_1_5 boolean required PT-INR >1.5 as assigned by the caller (Kiriyama 2018 TG18 Grade III hepatic dysfunction). true or false. magent does not interpret coagulation assays.
platelets_lt_100k boolean required Platelet count <100,000/mm³ as assigned by the caller (Kiriyama 2018 TG18 Grade III hematological dysfunction). true or false. magent does not assay platelets.
wbc_gt_12k_or_lt_4k boolean required White blood cell count >12,000/mm³ or <4,000/mm³ as assigned by the caller (Kiriyama 2018 TG18 Grade II). true or false. magent does not assay WBC.
fever_ge_39 boolean required Fever ≥39°C as assigned by the caller (Kiriyama 2018 TG18 Grade II). true or false. magent does not measure temperature.
bilirubin_ge_5 boolean required Total bilirubin ≥5 mg/dL as assigned by the caller (Kiriyama 2018 TG18 Grade II). true or false. magent does not assay bilirubin.
hypoalbuminemia boolean required Albumin <0.7× the local lower limit of normal as assigned by the caller (Kiriyama 2018 TG18 Grade II). true or false. magent does not assay albumin.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/tokyo_cholangitis Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "abnormal_lfts": "false",
      "age": "60",
      "biliary_dilatation": "false",
      "bilirubin_ge_5": "false",
      "decreased_consciousness": "false",
      "elevated_wbc_or_crp": "false",
      "etiology_on_imaging": "false",
      "fever_ge_39": "false",
      "fever_or_chills": "false",
      "hypoalbuminemia": "false",
      "hypotension_vasopressors": "false",
      "jaundice": "false",
      "oliguria_or_creatinine_gt_2": "false",
      "pfr_lt_300": "false",
      "platelets_lt_100k": "false",
      "pt_inr_gt_1_5": "false",
      "wbc_gt_12k_or_lt_4k": "false"
    },
    {
      "abnormal_lfts": "false",
      "age": "60",
      "biliary_dilatation": "false",
      "bilirubin_ge_5": "false",
      "decreased_consciousness": "false",
      "elevated_wbc_or_crp": "false",
      "etiology_on_imaging": "false",
      "fever_ge_39": "false",
      "fever_or_chills": "false",
      "hypoalbuminemia": "false",
      "hypotension_vasopressors": "false",
      "jaundice": "false",
      "oliguria_or_creatinine_gt_2": "false",
      "pfr_lt_300": "false",
      "platelets_lt_100k": "false",
      "pt_inr_gt_1_5": "false",
      "wbc_gt_12k_or_lt_4k": "false"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/tokyo_cholangitis",
  "items": [
    {
      "severity": "none",
      "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.",
      "citation": {
        "authors": "Kiriyama S, Kozaka K, Takada T, et al.",
        "doi": "10.1002/jhbp.512",
        "id": "kiriyama-2018",
        "pmid": "29032610",
        "source": "J Hepatobiliary Pancreat Sci. 2018;25(1):17-30",
        "title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholangitis (with videos)."
      },
      "formula": "tokyo_cholangitis",
      "formula_expression": "definite iff one A (fever_or_chills or elevated_wbc_or_crp) and one B (jaundice or abnormal_lfts) and one C (biliary_dilatation or etiology_on_imaging); suspected iff one A and one item in either B or C (not all three); else none. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any two Grade II items (wbc_gt_12k_or_lt_4k, fever_ge_39, age>=75, bilirubin_ge_5, hypoalbuminemia), else grade_i. When diagnosis is none, severity is none (Kiriyama 2018 TG18 = TG13 unmodified)",
      "criteria": [
        {
          "factor": "systemic_inflammation",
          "met": false
        },
        {
          "factor": "cholestasis",
          "met": false
        },
        {
          "factor": "imaging",
          "met": false
        },
        {
          "factor": "grade_iii_any",
          "met": false
        },
        {
          "factor": "grade_ii_two",
          "met": false
        },
        {
          "value": 60,
          "factor": "age_ge_75",
          "met": false
        },
        {
          "factor": "fever_or_chills",
          "met": false
        },
        {
          "factor": "elevated_wbc_or_crp",
          "met": false
        },
        {
          "factor": "jaundice",
          "met": false
        },
        {
          "factor": "abnormal_lfts",
          "met": false
        },
        {
          "factor": "biliary_dilatation",
          "met": false
        },
        {
          "factor": "etiology_on_imaging",
          "met": false
        },
        {
          "factor": "hypotension_vasopressors",
          "met": false
        },
        {
          "factor": "decreased_consciousness",
          "met": false
        },
        {
          "factor": "pfr_lt_300",
          "met": false
        },
        {
          "factor": "oliguria_or_creatinine_gt_2",
          "met": false
        },
        {
          "factor": "pt_inr_gt_1_5",
          "met": false
        },
        {
          "factor": "platelets_lt_100k",
          "met": false
        },
        {
          "factor": "wbc_gt_12k_or_lt_4k",
          "met": false
        },
        {
          "factor": "fever_ge_39",
          "met": false
        },
        {
          "factor": "bilirubin_ge_5",
          "met": false
        },
        {
          "factor": "hypoalbuminemia",
          "met": false
        }
      ],
      "diagnosis": "none"
    },
    {
      "severity": "none",
      "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.",
      "citation": {
        "authors": "Kiriyama S, Kozaka K, Takada T, et al.",
        "doi": "10.1002/jhbp.512",
        "id": "kiriyama-2018",
        "pmid": "29032610",
        "source": "J Hepatobiliary Pancreat Sci. 2018;25(1):17-30",
        "title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholangitis (with videos)."
      },
      "formula": "tokyo_cholangitis",
      "formula_expression": "definite iff one A (fever_or_chills or elevated_wbc_or_crp) and one B (jaundice or abnormal_lfts) and one C (biliary_dilatation or etiology_on_imaging); suspected iff one A and one item in either B or C (not all three); else none. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any two Grade II items (wbc_gt_12k_or_lt_4k, fever_ge_39, age>=75, bilirubin_ge_5, hypoalbuminemia), else grade_i. When diagnosis is none, severity is none (Kiriyama 2018 TG18 = TG13 unmodified)",
      "criteria": [
        {
          "factor": "systemic_inflammation",
          "met": false
        },
        {
          "factor": "cholestasis",
          "met": false
        },
        {
          "factor": "imaging",
          "met": false
        },
        {
          "factor": "grade_iii_any",
          "met": false
        },
        {
          "factor": "grade_ii_two",
          "met": false
        },
        {
          "value": 60,
          "factor": "age_ge_75",
          "met": false
        },
        {
          "factor": "fever_or_chills",
          "met": false
        },
        {
          "factor": "elevated_wbc_or_crp",
          "met": false
        },
        {
          "factor": "jaundice",
          "met": false
        },
        {
          "factor": "abnormal_lfts",
          "met": false
        },
        {
          "factor": "biliary_dilatation",
          "met": false
        },
        {
          "factor": "etiology_on_imaging",
          "met": false
        },
        {
          "factor": "hypotension_vasopressors",
          "met": false
        },
        {
          "factor": "decreased_consciousness",
          "met": false
        },
        {
          "factor": "pfr_lt_300",
          "met": false
        },
        {
          "factor": "oliguria_or_creatinine_gt_2",
          "met": false
        },
        {
          "factor": "pt_inr_gt_1_5",
          "met": false
        },
        {
          "factor": "platelets_lt_100k",
          "met": false
        },
        {
          "factor": "wbc_gt_12k_or_lt_4k",
          "met": false
        },
        {
          "factor": "fever_ge_39",
          "met": false
        },
        {
          "factor": "bilirubin_ge_5",
          "met": false
        },
        {
          "factor": "hypoalbuminemia",
          "met": false
        }
      ],
      "diagnosis": "none"
    }
  ]
}

Response

Field Type Description
formula string tokyo_cholangitis
formula_expression string Kiriyama 2018 TG18 (=TG13) acute cholangitis diagnostic criteria and severity grading
diagnosis string definite when one A, one B, and one C all hold; suspected when one A holds with one B or one C (not all three); otherwise none. Not a diagnosis that replaces imaging.
severity string none when diagnosis is none; otherwise grade_iii if any organ-dysfunction flag, else grade_ii if any two Grade II items, else grade_i. Grade III beats Grade II. Grade II is any two, not any one. Not a biliary-drainage order.
criteria array Rows for systemic_inflammation (A), cholestasis (B), imaging (C), grade_iii_any, grade_ii_two, age_ge_75, then each caller-assigned flag (factor and met)
citation object Kiriyama 2018 J Hepatobiliary Pancreat Sci citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "severity": "none",
  "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.",
  "citation": {
    "authors": "Kiriyama S, Kozaka K, Takada T, et al.",
    "doi": "10.1002/jhbp.512",
    "id": "kiriyama-2018",
    "pmid": "29032610",
    "source": "J Hepatobiliary Pancreat Sci. 2018;25(1):17-30",
    "title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholangitis (with videos)."
  },
  "formula": "tokyo_cholangitis",
  "formula_expression": "definite iff one A (fever_or_chills or elevated_wbc_or_crp) and one B (jaundice or abnormal_lfts) and one C (biliary_dilatation or etiology_on_imaging); suspected iff one A and one item in either B or C (not all three); else none. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any two Grade II items (wbc_gt_12k_or_lt_4k, fever_ge_39, age>=75, bilirubin_ge_5, hypoalbuminemia), else grade_i. When diagnosis is none, severity is none (Kiriyama 2018 TG18 = TG13 unmodified)",
  "criteria": [
    {
      "factor": "systemic_inflammation",
      "met": false
    },
    {
      "factor": "cholestasis",
      "met": false
    },
    {
      "factor": "imaging",
      "met": false
    },
    {
      "factor": "grade_iii_any",
      "met": false
    },
    {
      "factor": "grade_ii_two",
      "met": false
    },
    {
      "value": 60,
      "factor": "age_ge_75",
      "met": false
    },
    {
      "factor": "fever_or_chills",
      "met": false
    },
    {
      "factor": "elevated_wbc_or_crp",
      "met": false
    },
    {
      "factor": "jaundice",
      "met": false
    },
    {
      "factor": "abnormal_lfts",
      "met": false
    },
    {
      "factor": "biliary_dilatation",
      "met": false
    },
    {
      "factor": "etiology_on_imaging",
      "met": false
    },
    {
      "factor": "hypotension_vasopressors",
      "met": false
    },
    {
      "factor": "decreased_consciousness",
      "met": false
    },
    {
      "factor": "pfr_lt_300",
      "met": false
    },
    {
      "factor": "oliguria_or_creatinine_gt_2",
      "met": false
    },
    {
      "factor": "pt_inr_gt_1_5",
      "met": false
    },
    {
      "factor": "platelets_lt_100k",
      "met": false
    },
    {
      "factor": "wbc_gt_12k_or_lt_4k",
      "met": false
    },
    {
      "factor": "fever_ge_39",
      "met": false
    },
    {
      "factor": "bilirubin_ge_5",
      "met": false
    },
    {
      "factor": "hypoalbuminemia",
      "met": false
    }
  ],
  "diagnosis": "none"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • Tokyo cholecystitis — Apply Yokoe 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholecystitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags.
  • Alvarado score — Compute the Alvarado 1986 MANTRELS score from caller-assigned findings, temperature, WBC, and neutrophil percent.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.