# Narcotics Bowel Syndrome (Rome IV NBS / D2) Calculator

> Narcotics Bowel Syndrome (Rome IV NBS / D2) Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Evaluates seven clinician-assigned flags to determine if a patient meets Rome IV Narcotics Bowel Syndrome (D2) criteria per Keefer 2016, returning a boolean diagnosis result and a 0-3 NBS feature count.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/rome_iv_nbs
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/narcotics-bowel-syndrome-rome-iv-nbs-d2-calculator-5e669560
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tDgUdscDvelsvXu6MsWUq

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability narcotics-bowel-syndrome-rome-iv-nbs-d2-calculator-5e669560
```

Example prompt: My patient has chronic abdominal pain treated with narcotics occurring most days, the pain isn't explained by any GI diagnosis, it worsens with continued opioid use, gets markedly worse when the dose wanes and better when reinstituted, and there's been progression in frequency and intensity — all criteria have been met for the last 3 months with onset over 6 months ago; do they meet Rome IV Narcotics Bowel Syndrome (D2) criteria and how many NBS features are satisfied?

## When to prefer this

Use this endpoint when a clinician or clinical decision support workflow needs to formally apply the Rome IV Narcotics Bowel Syndrome (D2) criteria (Keefer 2016) to a patient with chronic or recurring abdominal pain on opioids. Prefer over manual scoring when auditable, reproducible, structured output is needed. Not appropriate for diagnosing CAPS, opioid-induced constipation, or any other functional GI disorder.

## Known failure modes

- Missing any of the seven required boolean query parameters returns a validation error
- Passing non-boolean values for flag parameters causes a schema error
- Network or payment (x402) failure returns no result
- Misassignment of flags by the caller produces incorrect NBS classification — garbage in, garbage out
- Caller confusing NBS with CAPS or opioid-induced constipation leads to inappropriate use

## How this service works

Keefer 2016 Rome IV NBS (D2). rome_iv_nbs is true iff chronic or frequently recurring abdominal pain on narcotics, pain not explained by a GI diagnosis, at least two of three NBS features, last-3-months criteria, and 6-month onset. nbs_features_met is 0-3. Caller assigns seven flags. ~75 mg oral morphine equivalent is copy-only. magent does not examine the patient or judge opioid dose. Not a diagnosis, not CAPS, not opioid-induced constipation.

## Output

Returns a boolean rome_iv_nbs indicating whether the patient meets Rome IV Narcotics Bowel Syndrome (D2) criteria per Keefer 2016, and an integer nbs_features_met (0–3) counting how many of the three NBS-specific features (worsens with continued/escalating narcotics, marked worsening when dose wanes, progression of episodes) are present. Does not provide a clinical diagnosis, does not assess opioid dose, and is distinct from CAPS or opioid-induced constipation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "chronic_or_frequently_recurring_abdominal_pain_on_narcotics",
      "pain_not_explained_by_current_or_previous_gi_diagnosis",
      "pain_worsens_or_incompletely_resolves_with_continued_or_escalating_narcotics",
      "marked_worsening_when_dose_wanes_improvement_when_reinstituted",
      "progression_of_frequency_duration_intensity_of_pain_episodes",
      "fulfilled_last_3_months",
      "onset_at_least_6_months"
     ],
     "properties": {
      "fulfilled_last_3_months": {
       "type": "boolean",
       "description": "Criteria fulfilled for the last 3 months, as assigned (Keefer 2016). true or false as assigned by the caller. magent does not take a history."
      },
      "onset_at_least_6_months": {
       "type": "boolean",
       "description": "Symptom onset at least 6 months prior to diagnosis, as assigned (Keefer 2016). true or false as assigned by the caller. magent does not take a history."
      },
      "pain_not_explained_by_current_or_previous_gi_diagnosis": {
       "type": "boolean",
       "description": "The nature and intensity of the pain is not explained by a current or previous GI diagnosis (a structural diagnosis may exist but is not sufficient to explain the pain), as assigned (Keefer 2016). true or false as assigned by the caller. magent does not examine the patient."
      },
      "chronic_or_frequently_recurring_abdominal_pain_on_narcotics": {
       "type": "boolean",
       "description": "Chronic or frequently recurring abdominal pain treated with acute high-dose or chronic narcotics; pain must occur most days, as assigned (Keefer 2016 Rome IV NBS / D2). Patients often take about 75 mg oral morphine equivalent; no particular time frame or dosage is required. true or false as assigned by the caller. magent does not examine the patient or judge opioid dose."
      },
      "progression_of_frequency_duration_intensity_of_pain_episodes": {
       "type"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/narcotics-bowel-syndrome-rome-iv-nbs-d2-calculator-5e669560/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
