GI · LIVE
Montreal IBD classification
Montreal IBD
Apply the Satsangi 2006 Montreal revision of the Vienna IBD classification and return the compact phenotype string for Crohn (age, location, behaviour, optional +L4 and p) or ulcerative colitis (extent and severity).
Markdown: /docs/montreal-ibd.md · Canonical: https://magentlab.com/docs/montreal-ibd
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply the Satsangi 2006 Montreal revision of the Vienna IBD classification and return the compact phenotype string for Crohn (age, location, behaviour, optional +L4 and p) or ulcerative colitis (extent and severity).
When to use
When an agent already has caller-assigned Montreal tokens (Crohn A1-A3, L1-L4, B1-B3, upper GI and perianal modifiers, or UC E1-E3 and S0-S3) and needs the published phenotype notation. magent does not perform endoscopy, take vitals, or assign the S token from labs. Not a disease-activity index.
When not to use
- Not a medical device.
- Not a diagnosis. magent does not diagnose Crohn disease or ulcerative colitis.
- Not a disease-activity index. This tool is phenotype notation only, not CDAI, Harvey-Bradshaw, or Mayo DAI.
- Not the Paris pediatric classification.
- IBDU and indeterminate colitis are not encoded; disease must be crohn or uc.
- The caller assigns all tokens, including UC severity S0-S3. magent does not perform endoscopy or take vitals.
Formula
Crohn phenotype = age_at_diagnosis (A1 ≤16 y, A2 17-40 y, A3 >40 y) + location (L1 ileal, L2 colonic, L3 ileocolonic, L4 isolated upper GI) + optional +L4 when concomitant upper GI with L1-L3 (forbidden when location is isolated L4) + behaviour (B1 non-stricturing non-penetrating, B2 stricturing, B3 penetrating) + optional p when concomitant perianal disease; UC phenotype = extent (E1 ulcerative proctitis distal to the rectosigmoid junction, E2 left-sided distal to the splenic flexure, E3 extensive proximal to the splenic flexure) + severity (S0 clinical remission, S1 mild, S2 moderate, S3 severe as assigned) (Satsangi 2006 Montreal revision of Vienna). Compact string, no spaces. Not a disease-activity score. magent does not perform endoscopy. Not Paris pediatric classification.
Citation
- Authors
- Satsangi J, Silverberg MS, Vermeire S, Colombel JF
- Source
- Gut. 2006;55(6):749-753
Worked example
Crohn A2 ileocolonic non-stricturing non-penetrating
Given:
age_at_diagnosis=A2behaviour=B1disease=crohnlocation=L3perianal=falseupper_gi=false
- disease crohn
- age_at_diagnosis A2 (17-40 y)
- location L3 ileocolonic
- upper_gi false (no +L4)
- behaviour B1 non-stricturing non-penetrating
- perianal false (no p)
- phenotype A2L3B1
UC ulcerative proctitis in clinical remission
Given:
disease=ucextent=E1severity=S0
- disease uc
- extent E1 ulcerative proctitis
- severity S0 clinical remission as assigned
- phenotype E1S0
Also searched as
- Montreal classification
- Montreal IBD
- Satsangi 2006
- Crohn phenotype A L B
- ulcerative colitis extent E1 E2 E3
- Montreal UC severity
- Vienna Montreal revision
- IBD phenotype notation
- Montreal L4 p modifier
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/montreal_ibd?disease=crohn&age_at_diagnosis=A2&location=L3&upper_gi=false&behaviour=B1&perianal=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/montreal_ibd?disease=crohn&age_at_diagnosis=A2&location=L3&upper_gi=false&behaviour=B1&perianal=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
disease |
string | required · crohn, uc | Satsangi 2006 Montreal disease as assigned: crohn or uc. IBDU and indeterminate colitis are not encoded. magent does not diagnose IBD. |
age_at_diagnosis |
string | optional · A1, A2, A3 | Montreal Crohn age at diagnosis as assigned (Satsangi 2006): A1 ≤16 years, A2 17-40 years, A3 >40 years. Required when disease=crohn. Omit when disease=uc. magent does not assign the A token from a chart. |
location |
string | optional · L1, L2, L3, L4 | Montreal Crohn location as assigned (Satsangi 2006): L1 ileal, L2 colonic, L3 ileocolonic, L4 isolated upper GI. Required when disease=crohn. Omit when disease=uc. magent does not perform endoscopy. |
upper_gi |
boolean | optional | Concomitant upper GI disease as assigned (Satsangi 2006 L4 modifier). true adds +L4 after L1, L2, or L3. Must be false when location is isolated L4. Required when disease=crohn. Omit when disease=uc. magent does not perform endoscopy. |
behaviour |
string | optional · B1, B2, B3 | Montreal Crohn behaviour as assigned (Satsangi 2006): B1 non-stricturing non-penetrating, B2 stricturing, B3 penetrating. Required when disease=crohn. Omit when disease=uc. magent does not perform endoscopy. |
perianal |
boolean | optional | Concomitant perianal disease as assigned (Satsangi 2006 p modifier). true appends p after B1, B2, or B3. Required when disease=crohn. Omit when disease=uc. magent does not examine the patient. |
extent |
string | optional · E1, E2, E3 | Montreal UC extent as assigned (Satsangi 2006): E1 ulcerative proctitis (distal to the rectosigmoid junction), E2 left-sided (distal to the splenic flexure), E3 extensive (proximal to the splenic flexure). Required when disease=uc. Omit when disease=crohn. magent does not perform endoscopy. |
severity |
string | optional · S0, S1, S2, S3 | Montreal UC severity as assigned (Satsangi 2006): S0 clinical remission; S1 mild (≤4 stools/day with or without blood, no systemic illness, normal ESR); S2 moderate (>4 stools/day, minimal systemic toxicity); S3 severe (≥6 bloody stools/day AND pulse ≥90 AND temperature ≥37.5°C AND haemoglobin <10.5 g/100 ml AND ESR ≥30 mm/h). The caller assigns the S token. Required when disease=uc. Omit when disease=crohn. magent does not take vitals. |
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": [
{
"age_at_diagnosis": "A2",
"behaviour": "B1",
"disease": "crohn",
"location": "L3",
"perianal": "false",
"upper_gi": "false"
},
{
"age_at_diagnosis": "A2",
"behaviour": "B1",
"disease": "crohn",
"location": "L3",
"perianal": "false",
"upper_gi": "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/montreal_ibd",
"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": "Satsangi J, Silverberg MS, Vermeire S, Colombel JF",
"doi": "10.1136/gut.2005.082909",
"id": "satsangi-2006",
"pmid": "16698746",
"source": "Gut. 2006;55(6):749-753",
"title": "The Montreal classification of inflammatory bowel disease: controversies, consensus, and implications"
},
"formula": "montreal_ibd",
"formula_expression": "Crohn phenotype = age_at_diagnosis (A1 ≤16 y, A2 17-40 y, A3 >40 y) + location (L1 ileal, L2 colonic, L3 ileocolonic, L4 isolated upper GI) + optional +L4 when concomitant upper GI with L1-L3 (forbidden when location is isolated L4) + behaviour (B1 non-stricturing non-penetrating, B2 stricturing, B3 penetrating) + optional p when concomitant perianal disease; UC phenotype = extent (E1 ulcerative proctitis distal to the rectosigmoid junction, E2 left-sided distal to the splenic flexure, E3 extensive proximal to the splenic flexure) + severity (S0 clinical remission, S1 mild, S2 moderate, S3 severe as assigned) (Satsangi 2006 Montreal revision of Vienna). Compact string, no spaces. Not a disease-activity score. magent does not perform endoscopy. Not Paris pediatric classification.",
"criteria": [
{
"factor": "disease_crohn",
"met": true
},
{
"factor": "disease_uc",
"met": false
},
{
"factor": "A1",
"met": false
},
{
"factor": "A2",
"met": true
},
{
"factor": "A3",
"met": false
},
{
"factor": "L1",
"met": false
},
{
"factor": "L2",
"met": false
},
{
"factor": "L3",
"met": true
},
{
"factor": "L4",
"met": false
},
{
"factor": "upper_gi",
"met": false
},
{
"factor": "B1",
"met": true
},
{
"factor": "B2",
"met": false
},
{
"factor": "B3",
"met": false
},
{
"factor": "perianal",
"met": false
}
],
"phenotype": "A2L3B1",
"disease": "crohn"
},
{
"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": "Satsangi J, Silverberg MS, Vermeire S, Colombel JF",
"doi": "10.1136/gut.2005.082909",
"id": "satsangi-2006",
"pmid": "16698746",
"source": "Gut. 2006;55(6):749-753",
"title": "The Montreal classification of inflammatory bowel disease: controversies, consensus, and implications"
},
"formula": "montreal_ibd",
"formula_expression": "Crohn phenotype = age_at_diagnosis (A1 ≤16 y, A2 17-40 y, A3 >40 y) + location (L1 ileal, L2 colonic, L3 ileocolonic, L4 isolated upper GI) + optional +L4 when concomitant upper GI with L1-L3 (forbidden when location is isolated L4) + behaviour (B1 non-stricturing non-penetrating, B2 stricturing, B3 penetrating) + optional p when concomitant perianal disease; UC phenotype = extent (E1 ulcerative proctitis distal to the rectosigmoid junction, E2 left-sided distal to the splenic flexure, E3 extensive proximal to the splenic flexure) + severity (S0 clinical remission, S1 mild, S2 moderate, S3 severe as assigned) (Satsangi 2006 Montreal revision of Vienna). Compact string, no spaces. Not a disease-activity score. magent does not perform endoscopy. Not Paris pediatric classification.",
"criteria": [
{
"factor": "disease_crohn",
"met": true
},
{
"factor": "disease_uc",
"met": false
},
{
"factor": "A1",
"met": false
},
{
"factor": "A2",
"met": true
},
{
"factor": "A3",
"met": false
},
{
"factor": "L1",
"met": false
},
{
"factor": "L2",
"met": false
},
{
"factor": "L3",
"met": true
},
{
"factor": "L4",
"met": false
},
{
"factor": "upper_gi",
"met": false
},
{
"factor": "B1",
"met": true
},
{
"factor": "B2",
"met": false
},
{
"factor": "B3",
"met": false
},
{
"factor": "perianal",
"met": false
}
],
"phenotype": "A2L3B1",
"disease": "crohn"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | montreal_ibd |
formula_expression |
string | Published Satsangi 2006 Montreal phenotype notation |
disease |
string | crohn or uc as assigned. IBDU is not encoded. |
phenotype |
string | Compact Montreal phenotype with no spaces. Crohn examples: A2L3B1, A2L3+L4B1, A2L3B1p, A1L4B2, A3L1+L4B3p. UC examples: E1S0, E2S1, E3S3. Not a disease-activity score. |
criteria |
array | Tree rows with factor and met for disease plus the exclusive Montreal tokens and Crohn modifiers used on that request |
citation |
object | Satsangi 2006 Gut 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": "Satsangi J, Silverberg MS, Vermeire S, Colombel JF",
"doi": "10.1136/gut.2005.082909",
"id": "satsangi-2006",
"pmid": "16698746",
"source": "Gut. 2006;55(6):749-753",
"title": "The Montreal classification of inflammatory bowel disease: controversies, consensus, and implications"
},
"formula": "montreal_ibd",
"formula_expression": "Crohn phenotype = age_at_diagnosis (A1 ≤16 y, A2 17-40 y, A3 >40 y) + location (L1 ileal, L2 colonic, L3 ileocolonic, L4 isolated upper GI) + optional +L4 when concomitant upper GI with L1-L3 (forbidden when location is isolated L4) + behaviour (B1 non-stricturing non-penetrating, B2 stricturing, B3 penetrating) + optional p when concomitant perianal disease; UC phenotype = extent (E1 ulcerative proctitis distal to the rectosigmoid junction, E2 left-sided distal to the splenic flexure, E3 extensive proximal to the splenic flexure) + severity (S0 clinical remission, S1 mild, S2 moderate, S3 severe as assigned) (Satsangi 2006 Montreal revision of Vienna). Compact string, no spaces. Not a disease-activity score. magent does not perform endoscopy. Not Paris pediatric classification.",
"criteria": [
{
"factor": "disease_crohn",
"met": true
},
{
"factor": "disease_uc",
"met": false
},
{
"factor": "A1",
"met": false
},
{
"factor": "A2",
"met": true
},
{
"factor": "A3",
"met": false
},
{
"factor": "L1",
"met": false
},
{
"factor": "L2",
"met": false
},
{
"factor": "L3",
"met": true
},
{
"factor": "L4",
"met": false
},
{
"factor": "upper_gi",
"met": false
},
{
"factor": "B1",
"met": true
},
{
"factor": "B2",
"met": false
},
{
"factor": "B3",
"met": false
},
{
"factor": "perianal",
"met": false
}
],
"phenotype": "A2L3B1",
"disease": "crohn"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_montreal_ibd |
Montreal IBD needs disease crohn or uc with the Satsangi 2006 phenotype tokens. 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
- Mayo DAI — Sum four caller-assigned Schroeder 1987 ulcerative colitis disease-activity index items (each integer 0-3) and return the total (max 12). Does not return later remission or activity bands.
- HBI — Sum Harvey 1980 simple-index items (previous-day well-being, abdominal pain, liquid stools, abdominal mass, and one point per listed complication) and return the total. Does not return later remission or activity bands.
- CDAI — Compute the Best 1976 Crohn's disease activity index from eight caller-assigned variables and return the rounded integer score. Does not return later trial activity bands.
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.