WEDGE
ANC
Compute absolute neutrophil count from WBC and neutrophil plus band percents, plus a Bodey 1966 granulocyte band.
Markdown: /docs/anc.md · Canonical: https://magentlab.com/docs/anc
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute absolute neutrophil count from WBC and neutrophil plus band percents, plus a Bodey 1966 granulocyte band.
When to use
When an agent needs ANC from a CBC differential and must not invent cells/µL.
When not to use
- Not a diagnosis. Bodey bands are granulocyte strata from acute-leukemia hospital days, not a febrile-neutropenia treatment plan.
- Does not convert a three-part differential or an absolute neutrophil count already reported by the lab.
Formula
ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100
Citation
- Title
- Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia
- Authors
- Bodey GP, Buckley M, Sathe YS, Freireich EJ
- Source
- Ann Intern Med. 1966;64(2):328-340
Worked example
6.0 K/µL, 50% segs, 3% bands
Given:
band_percent=3neutrophil_percent=50wbc_k_ul=6.0
- wbc_per_uL = 6.0 × 1000 = 6000
- fraction = (50 + 3) / 100 = 0.53
- ANC = 6000 × 0.53 = 3180
- Bodey band >1500
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/anc?wbc_k_ul=6.0&neutrophil_percent=50&band_percent=3
Full URL: https://api.magentlab.com/api/calc/anc?wbc_k_ul=6.0&neutrophil_percent=50&band_percent=3
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/anc?wbc_k_ul=6.0&neutrophil_percent=50&band_percent=3"
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 |
|---|---|---|---|
wbc_k_ul |
number | optional | WBC in 10^3/µL (same as 10^9/L). Provide wbc_k_ul or wbc_ul. Range 0.01-500. |
wbc_ul |
number | optional | WBC in cells/µL (same as cells/mm^3). Provide wbc_k_ul or wbc_ul. Range 10-500000. |
neutrophil_percent |
number | required | Segmented neutrophils / PMNs as a percent of WBC (0-100). |
band_percent |
number | optional | Band neutrophils as a percent of WBC (0-100). Omitted treats bands as 0. segs+bands must be ≤100. |
Bulk (POST)
POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- 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": [
{
"band_percent": "3",
"neutrophil_percent": "50",
"wbc_k_ul": "6.0"
},
{
"band_percent": "3",
"neutrophil_percent": "50",
"wbc_k_ul": "6.0"
}
]
}
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/anc",
"items": [
{
"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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
"doi": "10.7326/0003-4819-64-2-328",
"id": "bodey-1966",
"source": "Ann Intern Med. 1966;64(2):328-340",
"title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
},
"formula": "anc",
"formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
"wbc_per_ul": 6.0e3,
"anc_per_ul": 3180,
"band_percent": 3.0,
"bodey_granulocyte_band": ">1500",
"neutrophil_percent": 50.0
},
{
"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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
"doi": "10.7326/0003-4819-64-2-328",
"id": "bodey-1966",
"source": "Ann Intern Med. 1966;64(2):328-340",
"title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
},
"formula": "anc",
"formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
"wbc_per_ul": 6.0e3,
"anc_per_ul": 3180,
"band_percent": 3.0,
"bodey_granulocyte_band": ">1500",
"neutrophil_percent": 50.0
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | anc |
formula_expression |
string | Exact expression used |
wbc_per_ul |
number | Normalized WBC in cells/µL |
neutrophil_percent |
number | Segmented neutrophil percent used |
band_percent |
number | Band percent used (0 when omitted) |
anc_per_ul |
integer | Absolute neutrophil count in cells/µL |
bodey_granulocyte_band |
string | Bodey 1966 granulocyte strata (cells/mm^3 = cells/µL): <100, 100-500, 500-1000, 1000-1500, >1500. Not a diagnosis. |
citation |
object | Ann Intern Med 1966 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
"doi": "10.7326/0003-4819-64-2-328",
"id": "bodey-1966",
"source": "Ann Intern Med. 1966;64(2):328-340",
"title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
},
"formula": "anc",
"formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
"wbc_per_ul": 6.0e3,
"anc_per_ul": 3180,
"band_percent": 3.0,
"bodey_granulocyte_band": ">1500",
"neutrophil_percent": 50.0
}
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_wbc |
wbc_k_ul (0.01-500) or wbc_ul (10-500000) is required Returned before settlement; you are not charged. |
| 400 | invalid_neutrophil_percent |
neutrophil_percent must be a number from 0 to 100 Returned before settlement; you are not charged. |
| 400 | invalid_band_percent |
band_percent must be a number from 0 to 100 Returned before settlement; you are not charged. |
| 400 | invalid_differential |
neutrophil_percent + band_percent must be 0 to 100 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. |
| 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
- Mosteller BSA — Compute Mosteller body surface area in m^2 from height and weight.
Also searched as
- absolute neutrophil count
- ANC
- neutropenia count
- segs and bands
- granulocyte count
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.