78trust / 100

Calc Mets Ir

by magent in Security & trust

x402 APIPassing, checked 3 h ago

Bello-Chavolla 2018 METS-IR: ln(2×glucose_mg_dl + triglycerides_mg_dl)×BMI / ln(HDL_mg_dl), natural log, two decimals. Supply glucose, triglycerides, and HDL each as exactly one of mg/dL or mmol/L (glucose ×18, TG ×88.57, HDL ×38.67). BMI is caller-supplied (10–80). highest_quartile_t2d is true only when METS-IR > 50.39 (derivation highest T2D-risk quartile). Not a diabetes diagnosis, not HOMA-IR/HOMA2, and not a treatment threshold.

POST https://api.magentlab.com/api/calc/mets_ir

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
153 ms typical, 293 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.magentlab.com/api/calc/mets_ir" \
  -H "content-type: application/json" \
  -d '{"items":[{"bmi_kg_m2":25,"glucose_mg_dl":90,"glucose_mmol_l":5,"hdl_mg_dl":50,"hdl_mmol_l":1.29,"triglycerides_mg_dl":100,"triglycerides_mmol_l":1.13},{"bmi_kg_m2":25,"glucose_mg_dl":90,"glucose_mmol_l":5,"hdl_mg_dl":50,"hdl_mmol_l":1.29,"triglycerides_mg_dl":100,"triglycerides_mmol_l":1.13}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.magentlab.com%2Fapi%2Fcalc%2Fmets_ir
const res = await pay("https://api.magentlab.com/api/calc/mets_ir", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"items":[{"bmi_kg_m2":25,"glucose_mg_dl":90,"glucose_mmol_l":5,"hdl_mg_dl":50,"hdl_mmol_l":1.29,"triglycerides_mg_dl":100,"triglycerides_mmol_l":1.13},{"bmi_kg_m2":25,"glucose_mg_dl":90,"glucose_mmol_l":5,"hdl_mg_dl":50,"hdl_mmol_l":1.29,"triglycerides_mg_dl":100,"triglycerides_mmol_l":1.13}]}),
});
console.log(await res.json());

Example input

{
  "items": [
    {
      "bmi_kg_m2": 25,
      "glucose_mg_dl": 90,
      "glucose_mmol_l": 5,
      "hdl_mg_dl": 50,
      "hdl_mmol_l": 1.29,
      "triglycerides_mg_dl": 100,
      "triglycerides_mmol_l": 1.13
    },
    {
      "bmi_kg_m2": 25,
      "glucose_mg_dl": 90,
      "glucose_mmol_l": 5,
      "hdl_mg_dl": 50,
      "hdl_mmol_l": 1.29,
      "triglycerides_mg_dl": 100,
      "triglycerides_mmol_l": 1.13
    }
  ]
}

Example output

{
  "count": 2,
  "items": [
    {
      "bmi_kg_m2": 25,
      "citation": {
        "authors": "Bello-Chavolla OY, Almeda-Valdes P, Gomez-Velasco D, Viveros-Ruiz T, Cruz-Bautista I, Romo-Romo A, Sánchez-Lázaro D, Meza-Oviedo D, Vargas-Vázquez A, Campos OA, Sevilla-González MDR, Martagón AJ, Hernández LM, Mehta R, Caballeros-Barragán CR, Aguilar-Salinas CA",
        "doi": "10.1530/eje-17-0883",
        "id": "bello-chavolla-2018",
        "pmid": "29535168",
        "source": "Eur J Endocrinol. 2018;178(5):533-544",
        "title": "METS-IR, a novel score to evaluate insulin sensitivity, is predictive of visceral adiposity and incident type 2 diabetes"
      },
      "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.",
      "formula": "mets_ir",
      "formula_expression": "mets_ir = ln(2 * glucose_mg_dl + triglycerides_mg_dl) * bmi_kg_m2 / ln(hdl_mg_dl)",
      "glucose_mg_dl": 90,
      "hdl_mg_dl": 50,
      "highest_quartile_t2d": false,
      "mets_ir": 36.01,
      "triglycerides_mg_dl": 100
    },
    {
      "bmi_kg_m2": 25,
      "citation": {
        "authors": "Bello-Chavolla OY, Almeda-Valdes P, Gomez-Velasco D, Viveros-Ruiz T, Cruz-Bautista I, Romo-Romo A, Sánchez-Lázaro D, Meza-Oviedo D, Vargas-Vázquez A, Campos OA, Sevilla-González MDR, Martagón AJ, Hernández LM, Mehta R, Caballeros-Barragán CR, Aguilar-Salinas CA",
        "doi": "10.1530/eje-17-0883",
        "id": "bello-chavolla-2018",
        "pmid": "29535168",
        "source": "Eur J Endocrinol. 2018;178(5):533-544",
        "title": "METS-IR, a novel score to evaluate insulin sensitivity, is predictive of visceral adiposity and incident type 2 diabetes"
      },
      "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.",
      "formula": "mets_ir",
      "formula_expression": "mets_ir = ln(2 * glucose_mg_dl + triglycerides_mg_dl) * bmi_kg_m2 / ln(hdl_mg_dl)",
      "glucose_mg_dl": 90,
      "hdl_mg_dl": 50,
      "highest_quartile_t2d": false,
      "mets_ir": 36.01,
      "triglycerides_mg_dl": 100
    }
  ],
  "path": "/api/calc/mets_ir"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402293 ms$0.005
12 h agoPassed402222 ms$0.005
16 h agoPassed402149 ms$0.005
20 h agoPassed402146 ms$0.005
23 h agoPassed402156 ms$0.005
27 h agoPassed402153 ms$0.005
31 h agoPassed402139 ms$0.005
34 h agoPassed402145 ms$0.005
39 h agoPassed402549 ms$0.005