WEDGE
HAS-BLED
Deterministic bleeding-risk score from discrete flags. Chest 2010 citation.
When to use
HAS-BLED score from discrete clinical flags. Use for bleeding-risk arithmetic in atrial fibrillation. Deterministic published score with citation.
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/has_bled?age=78&hypertension=true&abnormal_renal=false&abnormal_liver=false&stroke=false&bleeding=false&labile_inr=false&drugs=false&alcohol=false
Request
GET
/api/calc/has_bled · x402 V2 · USDC on Base · $0.005 USDC
x402 V2 curl
Expect HTTP 402 and a PAYMENT-REQUIRED
header until you retry with PAYMENT-SIGNATURE.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/has_bled?age=78&hypertension=true&abnormal_renal=false&abnormal_liver=false&stroke=false&bleeding=false&labile_inr=false&drugs=false&alcohol=false"
Cursor mcp.json
Intended config for @magent/mcp. This is not npm @x402/fetch
(a payment fetch wrapper).
{
"mcpServers": {
"magent": {
"args": [
"-y",
"@magent/mcp"
],
"command": "npx",
"env": {
"X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
}
}
}
}
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). Age >65 scores 1 (E). |
hypertension |
boolean | required | Uncontrolled hypertension (H). true or false. |
abnormal_renal |
boolean | required | Abnormal renal function (A). true or false. |
abnormal_liver |
boolean | required | Abnormal liver function (A). true or false. Renal and liver each score 1. |
stroke |
boolean | required | Prior stroke (S). true or false. |
bleeding |
boolean | required | Bleeding history or predisposition (B). true or false. |
labile_inr |
boolean | required | Labile INR (L). true or false. |
drugs |
boolean | required | Concomitant antiplatelet or NSAID (D). true or false. |
alcohol |
boolean | required | Alcohol excess (D). true or false. Drugs and alcohol each score 1. |
Success fields
| Field | Type | Description |
|---|---|---|
formula |
string | has_bled |
score |
integer | Total points 0-9 |
max_score |
integer | Always 9 |
age_years |
integer | Age used for the E criterion |
components |
array | Per-factor points |
citation |
object | Chest 2010 citation |
disclaimer |
string | Not-a-device notice |
Example
Frozen fixture. Not a live lookup.
{
"components": [
{
"factor": "hypertension",
"points": 1,
"present": true
},
{
"factor": "abnormal_renal",
"points": 0,
"present": false
},
{
"factor": "abnormal_liver",
"points": 0,
"present": false
},
{
"factor": "stroke",
"points": 0,
"present": false
},
{
"factor": "bleeding",
"points": 0,
"present": false
},
{
"factor": "labile_inr",
"points": 0,
"present": false
},
{
"value": 78,
"factor": "elderly_age_gt_65",
"points": 1,
"present": true
},
{
"factor": "drugs",
"points": 0,
"present": false
},
{
"factor": "alcohol",
"points": 0,
"present": false
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"age_years": 78,
"citation": {
"authors": "Pisters R, Lane DA, Nieuwlaat R, de Vos CB, Crijns HJ, Lip GYH",
"doi": "10.1378/chest.10-0134",
"id": "pisters-2010",
"source": "Chest. 2010;138(5):1093-1100",
"title": "A novel user-friendly score (HAS-BLED) to assess 1-year risk of major bleeding in patients with atrial fibrillation: the Euro Heart Survey"
},
"formula": "has_bled",
"max_score": 9,
"score": 2
}
Payment
Unpaid requests return HTTP 402 with a base64 PAYMENT-REQUIRED
header. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the
tool runs. Full handshake and shared payment errors: Payments.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_age |
age must be an integer from 18 to 120 |
| 400 | invalid_flag |
boolean clinical flags must be true or false |
| 402 | payment_required |
Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header |
| 409 | payment_in_progress |
The same authorization nonce is already being settled; retry shortly |
| 429 | rate_limited |
Too many requests from this client |
| 503 | settlement_uncertain |
Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE |
| 503 | facilitator_unavailable |
Payment facilitator unavailable |
| 503 | facilitator_misconfigured |
Payment facilitator is not configured |
| 503 | facilitator_unauthorized |
Payment facilitator rejected credentials |
| 503 | ledger_unavailable |
Payment ledger unavailable |
| 503 | payment_unavailable |
Payment processing unavailable |
Guarantees
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Lookups run on our nodes — no third-party data API wrappers.
- Localhost, IP literals, and metadata hostnames are rejected.
- Execution is timeout-bounded and concurrency-capped.