MAGENT

LIVE

Wells PE

Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.

LIVE $0.005 USDC GET /api/calc/wells_pe

Markdown: /docs/wells-pe.md · Canonical: https://magentlab.com/docs/wells-pe

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

What it computes

Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.

When to use

When an agent needs the published Wells PE arithmetic and must not invent a probability from prose.

When not to use

  • Not a diagnosis. Bands are published cut-points, not a PE rule-out.
  • Flags are caller-supplied booleans. magent does not read imaging or D-dimer.

Formula

Wells PE = 3*signs_dvt + 3*pe_number_one + 1.5*hr_gt_100 + 1.5*immobilization_or_surgery + 1.5*previous_dvt_pe + 1*hemoptysis + 1*malignancy

Citation

Title
Excluding pulmonary embolism at the bedside without diagnostic imaging: management of patients with suspected pulmonary embolism presenting to the emergency department by using a simple clinical model and d-dimer
Authors
Wells PS, Anderson DR, Rodger M, et al.
Source
Ann Intern Med. 2001;135(2):98-107
DOI
10.7326/0003-4819-135-2-200107170-00010

Worked example

signs_dvt + pe_number_one

Given: hemoptysis=falsehr_gt_100=falseimmobilization_or_surgery=falsemalignancy=falsepe_number_one=trueprevious_dvt_pe=falsesigns_dvt=true

  1. signs_dvt → 3; pe_number_one → 3
  2. Score = 6.0 → three-tier moderate, two-tier likely (>4)

Try

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

/api/calc/wells_pe?signs_dvt=true&pe_number_one=true&hr_gt_100=false&immobilization_or_surgery=false&previous_dvt_pe=false&hemoptysis=false&malignancy=false

Full URL: https://api.magentlab.com/api/calc/wells_pe?signs_dvt=true&pe_number_one=true&hr_gt_100=false&immobilization_or_surgery=false&previous_dvt_pe=false&hemoptysis=false&malignancy=false

x402 V2 curl

Expect HTTP 402 and a PAYMENT-REQUIRED header 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/wells_pe?signs_dvt=true&pe_number_one=true&hr_gt_100=false&immobilization_or_surgery=false&previous_dvt_pe=false&hemoptysis=false&malignancy=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"
      }
    }
  }
}

Parameters

Name Type Required Description
signs_dvt boolean required Clinical signs and symptoms of DVT (3 points).
pe_number_one boolean required PE is the number-one diagnosis or equally likely (3 points).
hr_gt_100 boolean required Heart rate >100 (1.5 points).
immobilization_or_surgery boolean required Immobilization ≥3 days or surgery in previous 4 weeks (1.5 points).
previous_dvt_pe boolean required Previous DVT or PE (1.5 points).
hemoptysis boolean required Hemoptysis (1 point).
malignancy boolean required Malignancy with treatment in last 6 months or palliative (1 point).

Response

Field Type Description
formula string wells_pe
formula_expression string Exact expression used
score number Total points (0-12.5, 0.5 steps)
max_score number Always 12.5
three_tier string low (0-1), moderate (2-6), high (≥7). Not a diagnosis.
two_tier string likely (>4) or unlikely (≤4). Not a diagnosis.
components array Per-factor points
citation object Ann Intern Med 2001 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "factor": "signs_dvt",
      "points": 3.0,
      "present": true
    },
    {
      "factor": "pe_number_one",
      "points": 3.0,
      "present": true
    },
    {
      "factor": "hr_gt_100",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "immobilization_or_surgery",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "previous_dvt_pe",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "hemoptysis",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "malignancy",
      "points": 0.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.",
  "citation": {
    "authors": "Wells PS, Anderson DR, Rodger M, et al.",
    "doi": "10.7326/0003-4819-135-2-200107170-00010",
    "id": "wells-pe-2001",
    "source": "Ann Intern Med. 2001;135(2):98-107",
    "title": "Excluding pulmonary embolism at the bedside without diagnostic imaging: management of patients with suspected pulmonary embolism presenting to the emergency department by using a simple clinical model and d-dimer"
  },
  "formula": "wells_pe",
  "formula_expression": "Wells PE = 3*signs_dvt + 3*pe_number_one + 1.5*hr_gt_100 + 1.5*immobilization_or_surgery + 1.5*previous_dvt_pe + 1*hemoptysis + 1*malignancy",
  "max_score": 12.5,
  "score": 6.0,
  "three_tier": "moderate",
  "two_tier": "likely"
}

Errors

HTTP Code When
400 invalid_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
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

Related tools

  • Wells DVT — Compute the Wells deep-vein thrombosis probability score and return three-tier and two-tier bands.
  • CURB-65 — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.

Also searched as

  • Wells PE two-tier cutoff
  • Wells pulmonary embolism
  • PE likely unlikely
  • Wells PE score

Payment

Required query parameters must be present and valid. 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. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the tool runs. Full handshake and shared payment errors: Payments.

Guarantees

  • Invalid query parameters return HTTP 400 before settlement. You are not charged.
  • Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are not persisted. Request logs store path without query.