# Prague C and M criteria for Barrett esophagus

Prague C & M

Status: WEDGE
Price: $0.005 USDC
`GET /api/calc/prague`
HTML: https://magentlab.com/docs/prague
Markdown: https://magentlab.com/docs/prague.md

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

[The development and validation of an endoscopic grading system for Barrett's esophagus: the Prague C & M criteria.](https://doi.org/10.1053/j.gastro.2006.08.032)
Sharma P, Dent J, Armstrong D, et al.
Gastroenterology. 2006;131(5):1392-1399
DOI: [10.1053/j.gastro.2006.08.032](https://doi.org/10.1053/j.gastro.2006.08.032)

## Worked example

### No visualized Barrett (C0M0)

Given: `c_cm=0, m_cm=0`

1. c_cm is 0 (no circumferential Barrett as assigned)
2. m_cm is 0 (no maximal extent above the GEJ as assigned)
3. m_cm is >= c_cm; prague is C0M0


### Tongues only (C0M3)

Given: `c_cm=0, m_cm=3`

1. c_cm is 0 (no circumferential Barrett; tongues only)
2. m_cm is 3 (maximal tongue extent 3 cm above the GEJ)
3. 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

## Parameters

- `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.

Method: `POST /api/calc/prague`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 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:

```json
{
  "items": [
    {
      "c_cm": "0",
      "m_cm": "0"
    },
    {
      "c_cm": "0",
      "m_cm": "0"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/prague

Example 200:

```json
{
  "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 fields

- `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

Frozen fixture. Not a live lookup.

```json
{
  "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"
}
```

## Errors

- HTTP 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.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [LA grading](https://magentlab.com/docs/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](https://magentlab.com/docs/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.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
