77trust / 100

Calc Canadian Tia

by magent in Other

x402 APIPassing, checked 1 h ago

Perry 2021 Canadian TIA Score (Table 1) for 7-day stroke or carotid revascularization after TIA. Clinical: first TIA 2, symptoms >=10 min 2, past carotid stenosis 2, antiplatelet 3, gait 1, unilateral weakness 1, vertigo -3, diastolic >=110 3, dysarthria/aphasia 1. Investigations: AF on ECG 2, infarct on CT 1, platelets >=400 2, glucose >=15 mmol/L 3. Age required, 0 points. Total -3 to 23. Bands <=3 low (0.5%), 4-8 medium (2.3%), >=9 high (5.9%). Not ABCD2. Not a diagnosis or admit order.

POST
https://api.magentlab.com/api/calc/canadian_tia
Price
$0.005
per call in USDC
Uptime
96.8%
last 30 days
Response time
270 ms
459 ms slowest 5%
Last check
Passed
1 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

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

Each call costs $0.005 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://api.magentlab.com/api/calc/canadian_tia
content-type: application/json

{
  "items": [
    {
      "af_on_ecg": false,
      "age": 70,
      "carotid_stenosis": false,
      "diastolic_mm_hg": 80,
      "dysarthria_or_aphasia": false,
      "first_tia": false,
      "gait_disturbance": false,
      "glucose_mg_dl": 90,
      "glucose_mmol_l": 5,
      "infarct_on_ct": false,
      "on_antiplatelet": false,
      "platelets_10e9_l": 200,
      "symptoms_ge_10_min": false,
      "unilateral_weakness": false,
      "vertigo": false
    },
    {
      "af_on_ecg": false,
      "age": 70,
      "carotid_stenosis": false,
      "diastolic_mm_hg": 80,
      "dysarthria_or_aphasia": false,
      "first_tia": false,
      "gait_disturbance": false,
      "glucose_mg_dl": 90,
      "glucose_mmol_l": 5,
      "infarct_on_ct": false,
      "on_antiplatelet": false,
      "platelets_10e9_l": 200,
      "symptoms_ge_10_min": false,
      "unilateral_weakness": false,
      "vertigo": false
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
itemsarray of objectYes

Example response

The provider's example. We can't check it without paying.

Example response, 186 lines
{
  "count": 2,
  "items": [
    {
      "age_years": 70,
      "citation": {
        "authors": "Perry JJ, Sivilotti MLA, Émond M, Stiell IG, Stotts G, Lee J, Worster A, Morris J, Cheung KW, Jin AY, Oczkowski WJ, Sahlas DJ, Murray HE, Mackey A, Verreault S, Camden MC, Yip S, Teal P, Gladstone DJ, Boulos MI, Chagnon N, Shouldice E, Atzema C, Slaoui T, Teitlebaum J, Abdulaziz K, Nemnom MJ, Wells GA, Sharma M",
        "doi": "10.1136/bmj.n49",
        "id": "perry-2021",
        "pmid": "33541890",
        "source": "BMJ. 2021;372:n49",
        "title": "Prospective validation of Canadian TIA Score and comparison with ABCD2 and ABCD2i for subsequent stroke risk after transient ischaemic attack: multicentre prospective cohort study"
      },
      "components": [
        {
          "factor": "first_tia",
          "points": 0,
          "present": false
        },
        {
          "factor": "symptoms_ge_10_min",
          "points": 0,
          "present": false
        },
        {
          "factor": "carotid_stenosis",
          "points": 0,
          "present": false
        },
        {
          "factor": "on_antiplatelet",
          "points": 0,
          "present": false
        },
        {
          "factor": "gait_disturbance",
          "points": 0,
          "present": false
        },
        {
          "factor": "unilateral_weakness",
          "points": 0,
          "present": false
        },
        {
          "factor": "vertigo",
          "points": 0,
          "present": false
        },
        {
          "factor": "diastolic_mm_hg",
          "points": 0,
          "present": false,
          "value": 80
        },
        {
          "factor": "dysarthria_or_aphasia",
          "points": 0,
          "present": false
        },
        {
          "factor": "af_on_ecg",
          "points": 0,
          "present": false
        },
        {
          "factor": "infarct_on_ct",
          "points": 0,
          "present": false
        },
        {
          "factor": "platelets_10e9_l",
          "points": 0,
          "present": false,
          "value": 200
        },
        {
          "factor": "glucose",
          "points": 0,
          "present": false,
          "value": 5
        }
      ],
      "diastolic_mm_hg": 80,
      "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": "canadian_tia",
      "formula_expression": "Canadian TIA Score = first_tia 2 + symptoms_ge_10_min 2 + carotid_stenosis 2 + on_antiplatelet 3 + gait_disturbance 1 + unilateral_weakness 1 + vertigo -3 + (diastolic_mm_hg >= 110) 3 + dysarthria_or_aphasia 1 + af_on_ecg 2 + infarct_on_ct 1 + (platelets_10e9_l >= 400) 2 + (glucose >= 15 mmol/L) 3; age 18-120 required, 0 points; total -3 to 23; tia_risk low <=3 (0.5%), medium 4-8 (2.3%), high >=9 (5.9%) 7-day stroke or carotid revascularization (Perry 2021 Table 1 / Table 4); max 23",
      "glucose_mmol_l": 5,
      "max_score": 23,
      "platelets_10e9_l": 200,
      "score": 0,
      "tia_risk": "low"
    },
    {
      "age_years": 70,
      "citation": {
        "authors": "Perry JJ, Sivilotti MLA, Émond M, Stiell IG, Stotts G, Lee J, Worster A, Morris J, Cheung KW, Jin AY, Oczkowski WJ, Sahlas DJ, Murray HE, Mackey A, Verreault S, Camden MC, Yip S, Teal P, Gladstone DJ, Boulos MI, Chagnon N, Shouldice E, Atzema C, Slaoui T, Teitlebaum J, Abdulaziz K, Nemnom MJ, Wells GA, Sharma M",
        "doi": "10.1136/bmj.n49",
        "id": "perry-2021",
        "pmid": "33541890",
        "source": "BMJ. 2021;372:n49",
        "title": "Prospective validation of Canadian TIA Score and comparison with ABCD2 and ABCD2i for subsequent stroke risk after transient ischaemic attack: multicentre prospective cohort study"
      },
      "components": [
        {
          "factor": "first_tia",
          "points": 0,
          "present": false
        },
        {
          "factor": "symptoms_ge_10_min",
          "points": 0,
          "present": false
        },
        {
          "factor": "carotid_stenosis",
          "points": 0,
          "present": false
        },
        {
          "factor": "on_antiplatelet",
          "points": 0,
          "present": false
        },
        {
          "factor": "gait_disturbance",
          "points": 0,
          "present": false
        },
        {
          "factor": "unilateral_weakness",
          "points": 0,
          "present": false
        },
        {
          "factor": "vertigo",
          "points": 0,
          "present": false
        },
        {
          "factor": "diastolic_mm_hg",
          "points": 0,
          "present": false,
          "value": 80
        },
        {
          "factor": "dysarthria_or_aphasia",
          "points": 0,
          "present": false
        },
        {
          "factor": "af_on_ecg",
          "points": 0,
          "present": false
        },
        {
          "factor": "infarct_on_ct",
          "points": 0,
          "present": false
        },
        {
          "factor": "platelets_10e9_l",
          "points": 0,
          "present": false,
          "value": 200
        },
        {
          "factor": "glucose",
          "points": 0,
          "present": false,
          "value": 5
        }
      ],
      "diastolic_mm_hg": 80,
      "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": "canadian_tia",
      "formula_expression": "Canadian TIA Score = first_tia 2 + symptoms_ge_10_min 2 + carotid_stenosis 2 + on_antiplatelet 3 + gait_disturbance 1 + unilateral_weakness 1 + vertigo -3 + (diastolic_mm_hg >= 110) 3 + dysarthria_or_aphasia 1 + af_on_ecg 2 + infarct_on_ct 1 + (platelets_10e9_l >= 400) 2 + (glucose >= 15 mmol/L) 3; age 18-120 required, 0 points; total -3 to 23; tia_risk low <=3 (0.5%), medium 4-8 (2.3%), high >=9 (5.9%) 7-day stroke or carotid revascularization (Perry 2021 Table 1 / Table 4); max 23",
      "glucose_mmol_l": 5,
      "max_score": 23,
      "platelets_10e9_l": 200,
      "score": 0,
      "tia_risk": "low"
    }
  ],
  "path": "/api/calc/canadian_tia"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.005.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://api.magentlab.com/api/calc/canadian_tia' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"af_on_ecg":false,"age":70,"carotid_stenosis":false,"diastolic_mm_hg":80,"dysarthria_or_aphasia":false,"first_tia":false,"gait_disturbance":false,"glucose_mg_dl":90,"glucose_mmol_l":5,"infarct_on_ct":false,"on_antiplatelet":false,"platelets_10e9_l":200,"symptoms_ge_10_min":false,"unilateral_weakness":false,"vertigo":false},{"af_on_ecg":false,"age":70,"carotid_stenosis":false,"diastolic_mm_hg":80,"dysarthria_or_aphasia":false,"first_tia":false,"gait_disturbance":false,"glucose_mg_dl":90,"glucose_mmol_l":5,"infarct_on_ct":false,"on_antiplatelet":false,"platelets_10e9_l":200,"symptoms_ge_10_min":false,"unilateral_weakness":false,"vertigo":false}]}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://api.magentlab.com/api/calc/canadian_tia' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"af_on_ecg":false,"age":70,"carotid_stenosis":false,"diastolic_mm_hg":80,"dysarthria_or_aphasia":false,"first_tia":false,"gait_disturbance":false,"glucose_mg_dl":90,"glucose_mmol_l":5,"infarct_on_ct":false,"on_antiplatelet":false,"platelets_10e9_l":200,"symptoms_ge_10_min":false,"unilateral_weakness":false,"vertigo":false},{"af_on_ecg":false,"age":70,"carotid_stenosis":false,"diastolic_mm_hg":80,"dysarthria_or_aphasia":false,"first_tia":false,"gait_disturbance":false,"glucose_mg_dl":90,"glucose_mmol_l":5,"infarct_on_ct":false,"on_antiplatelet":false,"platelets_10e9_l":200,"symptoms_ge_10_min":false,"unilateral_weakness":false,"vertigo":false}]}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.005 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.005" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.005 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.magentlab.com%2Fapi%2Fcalc%2Fcanadian_tia&method=POST
const res = await pay("https://api.magentlab.com/api/calc/canadian_tia", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "items": [
      {
        "af_on_ecg": false,
        "age": 70,
        "carotid_stenosis": false,
        "diastolic_mm_hg": 80,
        "dysarthria_or_aphasia": false,
        "first_tia": false,
        "gait_disturbance": false,
        "glucose_mg_dl": 90,
        "glucose_mmol_l": 5,
        "infarct_on_ct": false,
        "on_antiplatelet": false,
        "platelets_10e9_l": 200,
        "symptoms_ge_10_min": false,
        "unilateral_weakness": false,
        "vertigo": false
      },
      {
        "af_on_ecg": false,
        "age": 70,
        "carotid_stenosis": false,
        "diastolic_mm_hg": 80,
        "dysarthria_or_aphasia": false,
        "first_tia": false,
        "gait_disturbance": false,
        "glucose_mg_dl": 90,
        "glucose_mmol_l": 5,
        "infarct_on_ct": false,
        "on_antiplatelet": false,
        "platelets_10e9_l": 200,
        "symptoms_ge_10_min": false,
        "unilateral_weakness": false,
        "vertigo": false
      }
    ]
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.005 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.005"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://api.magentlab.com/api/calc/canadian_tia",
        json={
            "items": [
                {
                    "af_on_ecg": False,
                    "age": 70,
                    "carotid_stenosis": False,
                    "diastolic_mm_hg": 80,
                    "dysarthria_or_aphasia": False,
                    "first_tia": False,
                    "gait_disturbance": False,
                    "glucose_mg_dl": 90,
                    "glucose_mmol_l": 5,
                    "infarct_on_ct": False,
                    "on_antiplatelet": False,
                    "platelets_10e9_l": 200,
                    "symptoms_ge_10_min": False,
                    "unilateral_weakness": False,
                    "vertigo": False,
                },
                {
                    "af_on_ecg": False,
                    "age": 70,
                    "carotid_stenosis": False,
                    "diastolic_mm_hg": 80,
                    "dysarthria_or_aphasia": False,
                    "first_tia": False,
                    "gait_disturbance": False,
                    "glucose_mg_dl": 90,
                    "glucose_mmol_l": 5,
                    "infarct_on_ct": False,
                    "on_antiplatelet": False,
                    "platelets_10e9_l": 200,
                    "symptoms_ge_10_min": False,
                    "unilateral_weakness": False,
                    "vertigo": False,
                },
            ],
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

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

Recent checks

WhenResultHTTPTimePrice
1 h agoPassed402237 ms$0.005
6 h agoPassed402440 ms$0.005
11 h agoPassed402233 ms$0.005
15 h agoPassed402167 ms$0.005
19 h agoPassed402276 ms$0.005
Show 10 older checks
23 h agoPassed402356 ms$0.005
28 h agoPassed402402 ms$0.005
32 h agoPassed402307 ms$0.005
36 h agoPassed402313 ms$0.005
40 h agoPassed402160 ms$0.005
45 h agoPassed402142 ms$0.005
2 days agoPassed402226 ms$0.005
2 days agoPassed402292 ms$0.005
2 days agoPassed402422 ms$0.005
3 days agoPassed402270 ms$0.005