Respiratory · LIVE
Modified Asthma Predictive Index
Apply Guilbert 2004 PEAK Table I and return a binary modified Asthma Predictive Index flag from caller-assigned history of 4 or more wheezing episodes and six major/minor criteria.
Markdown: /docs/mapi.md · Canonical: https://magentlab.com/docs/mapi
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply Guilbert 2004 PEAK Table I and return a binary modified Asthma Predictive Index flag from caller-assigned history of 4 or more wheezing episodes and six major/minor criteria.
When to use
When an agent has a caller-assigned history of 4 or more wheezing episodes in one year (at least one physician-diagnosed) and the published major and minor criteria for a child at high risk of childhood asthma and needs the Guilbert 2004 modified Asthma Predictive Index, not the Castro-Rodriguez 2000 original API, not Chang 2013 m²API, and not an asthma diagnosis.
When not to use
- Not a medical device. Not a diagnosis of asthma. magent does not examine the child.
- This tool is the Guilbert 2004 modified Asthma Predictive Index (mAPI, PEAK Table I) only. It is not the Castro-Rodriguez 2000 original Asthma Predictive Index (stringent and loose). It is not Chang 2013 m²API (≥2 wheeze episodes).
- The caller assigns 4 or more wheeze episodes, parental asthma, MD atopic dermatitis, aeroallergen sensitization, food sensitization to milk, egg, or peanut, wheezing unrelated to colds, and blood eosinophils ≥4%. magent does not take an eosinophil percent and does not interpret a CBC.
- Derivation was in the PEAK trial among children with recurrent wheezing at high risk for childhood asthma. magent does not take numeric age.
- positive is a published risk-index flag, not an asthma diagnosis or a treatment or inhaler order.
Formula
positive iff four_or_more_wheeze_episodes and (major_count >= 1 or minor_count >= 2); majors parental_asthma, md_atopic_dermatitis, aeroallergen_sensitization; minors food_sensitization_milk_egg_peanut, wheezing_unrelated_to_colds, eosinophilia_ge_4pct (Guilbert 2004 PEAK Table I)
Citation
- Authors
- Guilbert TW, Morgan WJ, Zeiger RS, et al.
- Source
- J Allergy Clin Immunol. 2004;114(6):1282-1287
Worked example
No four-or-more wheeze and no criteria
Given:
aeroallergen_sensitization=falseeosinophilia_ge_4pct=falsefood_sensitization_milk_egg_peanut=falsefour_or_more_wheeze_episodes=falsemd_atopic_dermatitis=falseparental_asthma=falsewheezing_unrelated_to_colds=false
- four_or_more_wheeze_episodes is false
- No major or minor criterion is present
- mAPI is not positive
Four-or-more wheeze with one major is positive
Given:
aeroallergen_sensitization=falseeosinophilia_ge_4pct=falsefood_sensitization_milk_egg_peanut=falsefour_or_more_wheeze_episodes=truemd_atopic_dermatitis=falseparental_asthma=truewheezing_unrelated_to_colds=false
- four_or_more_wheeze_episodes is true
- One major criterion (parental asthma) is present
- mAPI is positive
Four-or-more wheeze with two minors is positive
Given:
aeroallergen_sensitization=falseeosinophilia_ge_4pct=falsefood_sensitization_milk_egg_peanut=truefour_or_more_wheeze_episodes=truemd_atopic_dermatitis=falseparental_asthma=falsewheezing_unrelated_to_colds=true
- four_or_more_wheeze_episodes is true
- Two minor criteria and zero majors
- mAPI is positive
Also searched as
- Modified Asthma Predictive Index
- mAPI
- Guilbert 2004
- PEAK trial mAPI
- PEAK Table I
- modified Asthma Predictive Index
- aeroallergen sensitization wheeze
- Guilbert recurrent wheezing
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/mapi?four_or_more_wheeze_episodes=false&parental_asthma=false&md_atopic_dermatitis=false&aeroallergen_sensitization=false&food_sensitization_milk_egg_peanut=false&wheezing_unrelated_to_colds=false&eosinophilia_ge_4pct=false
Call
Expect HTTP 402 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/mapi?four_or_more_wheeze_episodes=false&parental_asthma=false&md_atopic_dermatitis=false&aeroallergen_sensitization=false&food_sensitization_milk_egg_peanut=false&wheezing_unrelated_to_colds=false&eosinophilia_ge_4pct=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
four_or_more_wheeze_episodes |
boolean | required | Caller-assigned history of 4 or more wheezing episodes in one year with at least one physician-diagnosed episode (Guilbert 2004 PEAK Table I primary criterion). true or false. magent does not take a numeric episode count. |
parental_asthma |
boolean | required | Parental asthma as assigned by the caller. true or false. Major criterion (Guilbert 2004 PEAK Table I). magent does not take a family history. |
md_atopic_dermatitis |
boolean | required | Physician-diagnosed atopic dermatitis as assigned by the caller. true or false. Major criterion (Guilbert 2004 PEAK Table I). magent does not examine the child. |
aeroallergen_sensitization |
boolean | required | Allergic sensitization to at least one aeroallergen as assigned by the caller. true or false. Major criterion (Guilbert 2004 PEAK Table I). magent does not interpret allergy testing. |
food_sensitization_milk_egg_peanut |
boolean | required | Allergic sensitization to milk, egg, or peanuts as assigned by the caller. true or false. Minor criterion (Guilbert 2004 PEAK Table I). magent does not interpret allergy testing. |
wheezing_unrelated_to_colds |
boolean | required | Wheezing unrelated to colds as assigned by the caller. true or false. Minor criterion (Guilbert 2004 PEAK Table I). magent does not auscultate. |
eosinophilia_ge_4pct |
boolean | required | Blood eosinophils ≥4% of WBC as assigned by the caller (Guilbert 2004 PEAK Table I; 4% or greater). true or false. Minor criterion. magent does not take an eosinophil percent and does not interpret a CBC. Not Castro-Rodriguez circulating eosinophils >4%. |
Bulk (POST)
POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- 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": [
{
"aeroallergen_sensitization": "false",
"eosinophilia_ge_4pct": "false",
"food_sensitization_milk_egg_peanut": "false",
"four_or_more_wheeze_episodes": "false",
"md_atopic_dermatitis": "false",
"parental_asthma": "false",
"wheezing_unrelated_to_colds": "false"
},
{
"aeroallergen_sensitization": "false",
"eosinophilia_ge_4pct": "false",
"food_sensitization_milk_egg_peanut": "false",
"four_or_more_wheeze_episodes": "false",
"md_atopic_dermatitis": "false",
"parental_asthma": "false",
"wheezing_unrelated_to_colds": "false"
}
]
}
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/mapi",
"items": [
{
"positive": false,
"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": "Guilbert TW, Morgan WJ, Zeiger RS, et al.",
"doi": "10.1016/j.jaci.2004.09.020",
"id": "guilbert-2004",
"pmid": "15577824",
"source": "J Allergy Clin Immunol. 2004;114(6):1282-1287",
"title": "Atopic characteristics of children with recurrent wheezing at high risk for the development of childhood asthma"
},
"formula": "mapi",
"formula_expression": "positive iff four_or_more_wheeze_episodes and (major_count >= 1 or minor_count >= 2); majors parental_asthma, md_atopic_dermatitis, aeroallergen_sensitization; minors food_sensitization_milk_egg_peanut, wheezing_unrelated_to_colds, eosinophilia_ge_4pct (Guilbert 2004 PEAK Table I)",
"criteria": [
{
"factor": "four_or_more_wheeze_episodes",
"met": false
},
{
"factor": "parental_asthma",
"met": false
},
{
"factor": "md_atopic_dermatitis",
"met": false
},
{
"factor": "aeroallergen_sensitization",
"met": false
},
{
"factor": "food_sensitization_milk_egg_peanut",
"met": false
},
{
"factor": "wheezing_unrelated_to_colds",
"met": false
},
{
"factor": "eosinophilia_ge_4pct",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"four_or_more_wheeze_episodes": false
},
{
"positive": false,
"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": "Guilbert TW, Morgan WJ, Zeiger RS, et al.",
"doi": "10.1016/j.jaci.2004.09.020",
"id": "guilbert-2004",
"pmid": "15577824",
"source": "J Allergy Clin Immunol. 2004;114(6):1282-1287",
"title": "Atopic characteristics of children with recurrent wheezing at high risk for the development of childhood asthma"
},
"formula": "mapi",
"formula_expression": "positive iff four_or_more_wheeze_episodes and (major_count >= 1 or minor_count >= 2); majors parental_asthma, md_atopic_dermatitis, aeroallergen_sensitization; minors food_sensitization_milk_egg_peanut, wheezing_unrelated_to_colds, eosinophilia_ge_4pct (Guilbert 2004 PEAK Table I)",
"criteria": [
{
"factor": "four_or_more_wheeze_episodes",
"met": false
},
{
"factor": "parental_asthma",
"met": false
},
{
"factor": "md_atopic_dermatitis",
"met": false
},
{
"factor": "aeroallergen_sensitization",
"met": false
},
{
"factor": "food_sensitization_milk_egg_peanut",
"met": false
},
{
"factor": "wheezing_unrelated_to_colds",
"met": false
},
{
"factor": "eosinophilia_ge_4pct",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"four_or_more_wheeze_episodes": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | mapi |
formula_expression |
string | Guilbert 2004 PEAK Table I mAPI binary positive rule |
positive |
boolean | true when four_or_more_wheeze_episodes is true and at least one major criterion is present or at least two minor criteria are present. Not a diagnosis of asthma. |
major_count |
integer | Count of true major criteria (parental_asthma, md_atopic_dermatitis, aeroallergen_sensitization); 0-3 |
minor_count |
integer | Count of true minor criteria (food_sensitization_milk_egg_peanut, wheezing_unrelated_to_colds, eosinophilia_ge_4pct); 0-3 |
four_or_more_wheeze_episodes |
boolean | Parsed primary criterion: caller-assigned history of 4 or more wheezing episodes in one year with at least one physician-diagnosed episode |
criteria |
array | Per-criterion rows with factor and met for the primary four-or-more wheeze flag then three majors then three minors; met is true when that Table I finding is present |
citation |
object | Guilbert 2004 J Allergy Clin Immunol citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"positive": false,
"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": "Guilbert TW, Morgan WJ, Zeiger RS, et al.",
"doi": "10.1016/j.jaci.2004.09.020",
"id": "guilbert-2004",
"pmid": "15577824",
"source": "J Allergy Clin Immunol. 2004;114(6):1282-1287",
"title": "Atopic characteristics of children with recurrent wheezing at high risk for the development of childhood asthma"
},
"formula": "mapi",
"formula_expression": "positive iff four_or_more_wheeze_episodes and (major_count >= 1 or minor_count >= 2); majors parental_asthma, md_atopic_dermatitis, aeroallergen_sensitization; minors food_sensitization_milk_egg_peanut, wheezing_unrelated_to_colds, eosinophilia_ge_4pct (Guilbert 2004 PEAK Table I)",
"criteria": [
{
"factor": "four_or_more_wheeze_episodes",
"met": false
},
{
"factor": "parental_asthma",
"met": false
},
{
"factor": "md_atopic_dermatitis",
"met": false
},
{
"factor": "aeroallergen_sensitization",
"met": false
},
{
"factor": "food_sensitization_milk_egg_peanut",
"met": false
},
{
"factor": "wheezing_unrelated_to_colds",
"met": false
},
{
"factor": "eosinophilia_ge_4pct",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"four_or_more_wheeze_episodes": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_flag |
boolean clinical flags must be true or false 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. |
Related tools
- Asthma Predictive Index — Apply Castro-Rodriguez 2000 Table 1 and return stringent and loose Asthma Predictive Index flags from caller-assigned early-wheeze class and five major/minor criteria.
- PRAM — Sum five caller-assigned Chalut 2000 PRAM item points and return the published 0-12 total.
Payment
Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, 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. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /docs/mcp.
Guarantees
- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.