GI · WEDGE
Prague C and M criteria for Barrett esophagus
Prague C & M
Format Sharma 2006 Prague C and M criteria as C{c}M{m} from caller-assigned circumferential (c_cm) and maximal (m_cm) extent of visualized Barrett mucosa in centimetres above the gastroesophageal junction.
Markdown: /docs/prague.md · Canonical: https://magentlab.com/docs/prague
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Format Sharma 2006 Prague C and M criteria as C{c}M{m} from caller-assigned circumferential (c_cm) and maximal (m_cm) extent of visualized Barrett mucosa in centimetres above the gastroesophageal junction.
When to use
When an agent already has endoscopic C and M measurements in centimetres and needs the published Prague label. magent does not perform endoscopy or diagnose Barrett esophagus.
When not to use
- Not a medical device.
- Not a Barrett esophagus diagnosis. Histology is required. magent does not perform endoscopy.
- The caller assigns c_cm and m_cm. magent does not measure lesions or interpret endoscopy images.
- This tool is Sharma 2006 Prague C and M extent only. Not Los Angeles oesophagitis grading (LA A-D). Not a histology diagnosis.
- C=0 is allowed (no circumferential Barrett; tongues only). M must be greater than or equal to C. Inputs are integers 0-20 cm.
Formula
prague is C{c_cm}M{m_cm} (no spaces) from caller-assigned circumferential extent c_cm (cm of visualized Barrett above the gastroesophageal junction, integer 0-20) and maximal extent m_cm (cm above GEJ, integer 0-20); m_cm must be >= c_cm; C=0 is no circumferential Barrett (tongues only); Sharma 2006 Prague C and M; not a Barrett diagnosis (histology required); magent does not perform endoscopy
Citation
- Authors
- Sharma P, Dent J, Armstrong D, et al.
- Source
- Gastroenterology. 2006;131(5):1392-1399
Worked example
No visualized Barrett (C0M0)
Given:
c_cm=0m_cm=0
- c_cm is 0 (no circumferential Barrett as assigned)
- m_cm is 0 (no maximal extent above the GEJ as assigned)
- m_cm is >= c_cm; prague is C0M0
Tongues only (C0M3)
Given:
c_cm=0m_cm=3
- c_cm is 0 (no circumferential Barrett; tongues only)
- m_cm is 3 (maximal tongue extent 3 cm above the GEJ)
- m_cm is >= c_cm; prague is C0M3
Also searched as
- Prague C and M
- Prague criteria Barrett
- Barrett C and M
- Sharma 2006 Prague
- circumferential Barrett extent
- maximal Barrett extent
- Prague C&M criteria
- Barrett esophagus Prague
- C and M criteria
- gastroesophageal junction Barrett
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/prague?c_cm=0&m_cm=0
Full URL: https://api.magentlab.com/api/calc/prague?c_cm=0&m_cm=0
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/prague?c_cm=0&m_cm=0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
c_cm |
integer | required | Caller-assigned circumferential extent of visualized Barrett mucosa in centimetres above the gastroesophageal junction (integer 0-20). C=0 is allowed (no circumferential Barrett; tongues only). magent does not perform endoscopy. |
m_cm |
integer | required | Caller-assigned maximal extent of visualized Barrett mucosa in centimetres above the gastroesophageal junction (integer 0-20). Must be greater than or equal to c_cm. magent does not perform endoscopy. |
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": [
{
"c_cm": "0",
"m_cm": "0"
},
{
"c_cm": "0",
"m_cm": "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/prague",
"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": "Sharma P, Dent J, Armstrong D, et al.",
"doi": "10.1053/j.gastro.2006.08.032",
"id": "sharma-2006",
"pmid": "17101315",
"source": "Gastroenterology. 2006;131(5):1392-1399",
"title": "The development and validation of an endoscopic grading system for Barrett's esophagus: the Prague C & M criteria."
},
"formula": "prague",
"formula_expression": "prague is C{c_cm}M{m_cm} (no spaces) from caller-assigned circumferential extent c_cm (cm of visualized Barrett above the gastroesophageal junction, integer 0-20) and maximal extent m_cm (cm above GEJ, integer 0-20); m_cm must be >= c_cm; C=0 is no circumferential Barrett (tongues only); Sharma 2006 Prague C and M; not a Barrett diagnosis (histology required); magent does not perform endoscopy",
"c_cm": 0,
"m_cm": 0,
"prague": "C0M0"
},
{
"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": "Sharma P, Dent J, Armstrong D, et al.",
"doi": "10.1053/j.gastro.2006.08.032",
"id": "sharma-2006",
"pmid": "17101315",
"source": "Gastroenterology. 2006;131(5):1392-1399",
"title": "The development and validation of an endoscopic grading system for Barrett's esophagus: the Prague C & M criteria."
},
"formula": "prague",
"formula_expression": "prague is C{c_cm}M{m_cm} (no spaces) from caller-assigned circumferential extent c_cm (cm of visualized Barrett above the gastroesophageal junction, integer 0-20) and maximal extent m_cm (cm above GEJ, integer 0-20); m_cm must be >= c_cm; C=0 is no circumferential Barrett (tongues only); Sharma 2006 Prague C and M; not a Barrett diagnosis (histology required); magent does not perform endoscopy",
"c_cm": 0,
"m_cm": 0,
"prague": "C0M0"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | prague |
formula_expression |
string | Published Sharma 2006 Prague C and M label format |
prague |
string | C{c_cm}M{m_cm} label with no spaces, for example C2M5 |
c_cm |
integer | Caller-assigned circumferential extent in cm (0-20) |
m_cm |
integer | Caller-assigned maximal extent in cm (0-20); >= c_cm |
citation |
object | Sharma 2006 Gastroenterology 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": "Sharma P, Dent J, Armstrong D, et al.",
"doi": "10.1053/j.gastro.2006.08.032",
"id": "sharma-2006",
"pmid": "17101315",
"source": "Gastroenterology. 2006;131(5):1392-1399",
"title": "The development and validation of an endoscopic grading system for Barrett's esophagus: the Prague C & M criteria."
},
"formula": "prague",
"formula_expression": "prague is C{c_cm}M{m_cm} (no spaces) from caller-assigned circumferential extent c_cm (cm of visualized Barrett above the gastroesophageal junction, integer 0-20) and maximal extent m_cm (cm above GEJ, integer 0-20); m_cm must be >= c_cm; C=0 is no circumferential Barrett (tongues only); Sharma 2006 Prague C and M; not a Barrett diagnosis (histology required); magent does not perform endoscopy",
"c_cm": 0,
"m_cm": 0,
"prague": "C0M0"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_prague |
c_cm and m_cm must be integers from 0 to 20 and m_cm must be greater than or equal to c_cm (Sharma 2006 Prague C and M). 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
- LA grading — Apply Lundell 1999 Table 1 Los Angeles classification of oesophagitis and return la_grade (none, A, B, C, or D) from four caller-assigned endoscopic flags.
- EREFS — Sum five caller-assigned Hirano 2013 modified EREFS descriptors (edema 0-1, rings 0-3, exudates 0-2, furrows 0-1 after collapsing original 0-2, stricture 0-1) and return the total (max 8). Does not return activity bands, inflammatory or fibrostenotic subscores, or later 0-9 furrows 0-2 expansions.
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.