{
  "x402Version": 2,
  "id": 39054,
  "slug": "39054",
  "resource": "https://api.magentlab.com/api/calc/rome_iv_functional_defecation",
  "description": "Rao 2016 Rome IV F3. rome_iv_functional_defecation is true iff FC and/or IBS-C, at least two of three evacuation tests (balloon expulsion, manometry or anal surface EMG, imaging), last-3-months criteria, and 6-month onset. evacuation_tests_met is 0-3. magent does not perform those tests. Not a diagnosis. Not F3a or F3b as separate diagnoses.",
  "type": "http",
  "serviceName": "magent",
  "resourceType": "Agent Service",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x836Be278f1739fB4308091cD1852F7971Bc19Ee2",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000",
      "amountUsd": 0.005,
      "maxTimeoutSeconds": 600
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "iconUrl": "https://api.magentlab.com/favicon.ico",
        "input": {
          "body": {
            "items": [
              {
                "abnormal_anorectal_evacuation_pattern_manometry_or_emg": true,
                "abnormal_balloon_expulsion": true,
                "fulfilled_last_3_months": true,
                "impaired_rectal_evacuation_by_imaging": false,
                "onset_at_least_6_months": true,
                "satisfies_fc_and_or_ibs_with_constipation": true
              },
              {
                "abnormal_anorectal_evacuation_pattern_manometry_or_emg": true,
                "abnormal_balloon_expulsion": true,
                "fulfilled_last_3_months": true,
                "impaired_rectal_evacuation_by_imaging": false,
                "onset_at_least_6_months": true,
                "satisfies_fc_and_or_ibs_with_constipation": true
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "citation": {
                  "authors": "Rao SSC, Bharucha AE, Chiarioni G, Felt-Bersma R, Knowles C, Malcolm A, Wald A",
                  "doi": "10.1053/j.gastro.2016.02.009",
                  "id": "rao-2016",
                  "pmid": "27144630",
                  "source": "Gastroenterology. 2016;150(6):1430-1442",
                  "title": "Anorectal Disorders"
                },
                "criteria": [
                  {
                    "factor": "satisfies_fc_and_or_ibs_with_constipation",
                    "met": true
                  },
                  {
                    "factor": "abnormal_balloon_expulsion",
                    "met": true
                  },
                  {
                    "factor": "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                    "met": true
                  },
                  {
                    "factor": "impaired_rectal_evacuation_by_imaging",
                    "met": false
                  },
                  {
                    "factor": "fulfilled_last_3_months",
                    "met": true
                  },
                  {
                    "factor": "onset_at_least_6_months",
                    "met": true
                  },
                  {
                    "factor": "evacuation_tests_ge_2",
                    "met": true,
                    "value": 2
                  }
                ],
                "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.",
                "evacuation_tests_met": 2,
                "formula": "rome_iv_functional_defecation",
                "formula_expression": "rome_iv_functional_defecation iff satisfies_fc_and_or_ibs_with_constipation and evacuation_tests_met >= 2 and fulfilled_last_3_months and onset_at_least_6_months; evacuation_tests_met counts abnormal_balloon_expulsion, abnormal_anorectal_evacuation_pattern_manometry_or_emg, and impaired_rectal_evacuation_by_imaging (Rao 2016 Rome IV F3 functional defecation disorders)",
                "rome_iv_functional_defecation": true
              },
              {
                "citation": {
                  "authors": "Rao SSC, Bharucha AE, Chiarioni G, Felt-Bersma R, Knowles C, Malcolm A, Wald A",
                  "doi": "10.1053/j.gastro.2016.02.009",
                  "id": "rao-2016",
                  "pmid": "27144630",
                  "source": "Gastroenterology. 2016;150(6):1430-1442",
                  "title": "Anorectal Disorders"
                },
                "criteria": [
                  {
                    "factor": "satisfies_fc_and_or_ibs_with_constipation",
                    "met": true
                  },
                  {
                    "factor": "abnormal_balloon_expulsion",
                    "met": true
                  },
                  {
                    "factor": "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                    "met": true
                  },
                  {
                    "factor": "impaired_rectal_evacuation_by_imaging",
                    "met": false
                  },
                  {
                    "factor": "fulfilled_last_3_months",
                    "met": true
                  },
                  {
                    "factor": "onset_at_least_6_months",
                    "met": true
                  },
                  {
                    "factor": "evacuation_tests_ge_2",
                    "met": true,
                    "value": 2
                  }
                ],
                "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.",
                "evacuation_tests_met": 2,
                "formula": "rome_iv_functional_defecation",
                "formula_expression": "rome_iv_functional_defecation iff satisfies_fc_and_or_ibs_with_constipation and evacuation_tests_met >= 2 and fulfilled_last_3_months and onset_at_least_6_months; evacuation_tests_met counts abnormal_balloon_expulsion, abnormal_anorectal_evacuation_pattern_manometry_or_emg, and impaired_rectal_evacuation_by_imaging (Rao 2016 Rome IV F3 functional defecation disorders)",
                "rome_iv_functional_defecation": true
              }
            ],
            "path": "/api/calc/rome_iv_functional_defecation"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "abnormal_anorectal_evacuation_pattern_manometry_or_emg": {
                          "description": "Abnormal anorectal evacuation pattern with manometry or anal surface EMG (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform manometry or EMG.",
                          "type": "boolean"
                        },
                        "abnormal_balloon_expulsion": {
                          "description": "Abnormal balloon expulsion test (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform balloon expulsion.",
                          "type": "boolean"
                        },
                        "fulfilled_last_3_months": {
                          "description": "Criteria fulfilled for the last 3 months, as assigned (Rao 2016). true or false as assigned by the caller. magent does not take a history.",
                          "type": "boolean"
                        },
                        "impaired_rectal_evacuation_by_imaging": {
                          "description": "Impaired rectal evacuation by imaging (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform imaging.",
                          "type": "boolean"
                        },
                        "onset_at_least_6_months": {
                          "description": "Symptom onset at least 6 months prior to diagnosis, as assigned (Rao 2016). true or false as assigned by the caller. magent does not take a history.",
                          "type": "boolean"
                        },
                        "satisfies_fc_and_or_ibs_with_constipation": {
                          "description": "The patient already satisfies diagnostic criteria for functional constipation and/or IBS with constipation, as assigned (Rao 2016 F3). true or false as assigned by the caller. magent does not re-run those tools.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "satisfies_fc_and_or_ibs_with_constipation",
                        "abnormal_balloon_expulsion",
                        "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                        "impaired_rectal_evacuation_by_imaging",
                        "fulfilled_last_3_months",
                        "onset_at_least_6_months"
                      ],
                      "type": "object"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "items"
                ],
                "type": "object"
              },
              "headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "method": {
                "const": "POST",
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "rome-iv-fdd",
    "functional-defecation",
    "gi",
    "anorectal",
    "rome-iv",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-13T08:01:21.66Z",
  "quality": {
    "calls30d": 5,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-13T08:01:21.521Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "abnormal_anorectal_evacuation_pattern_manometry_or_emg": true,
                  "abnormal_balloon_expulsion": true,
                  "fulfilled_last_3_months": true,
                  "impaired_rectal_evacuation_by_imaging": false,
                  "onset_at_least_6_months": true,
                  "satisfies_fc_and_or_ibs_with_constipation": true
                },
                {
                  "abnormal_anorectal_evacuation_pattern_manometry_or_emg": true,
                  "abnormal_balloon_expulsion": true,
                  "fulfilled_last_3_months": true,
                  "impaired_rectal_evacuation_by_imaging": false,
                  "onset_at_least_6_months": true,
                  "satisfies_fc_and_or_ibs_with_constipation": true
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "citation": {
                    "authors": "Rao SSC, Bharucha AE, Chiarioni G, Felt-Bersma R, Knowles C, Malcolm A, Wald A",
                    "doi": "10.1053/j.gastro.2016.02.009",
                    "id": "rao-2016",
                    "pmid": "27144630",
                    "source": "Gastroenterology. 2016;150(6):1430-1442",
                    "title": "Anorectal Disorders"
                  },
                  "criteria": [
                    {
                      "factor": "satisfies_fc_and_or_ibs_with_constipation",
                      "met": true
                    },
                    {
                      "factor": "abnormal_balloon_expulsion",
                      "met": true
                    },
                    {
                      "factor": "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                      "met": true
                    },
                    {
                      "factor": "impaired_rectal_evacuation_by_imaging",
                      "met": false
                    },
                    {
                      "factor": "fulfilled_last_3_months",
                      "met": true
                    },
                    {
                      "factor": "onset_at_least_6_months",
                      "met": true
                    },
                    {
                      "factor": "evacuation_tests_ge_2",
                      "met": true,
                      "value": 2
                    }
                  ],
                  "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.",
                  "evacuation_tests_met": 2,
                  "formula": "rome_iv_functional_defecation",
                  "formula_expression": "rome_iv_functional_defecation iff satisfies_fc_and_or_ibs_with_constipation and evacuation_tests_met >= 2 and fulfilled_last_3_months and onset_at_least_6_months; evacuation_tests_met counts abnormal_balloon_expulsion, abnormal_anorectal_evacuation_pattern_manometry_or_emg, and impaired_rectal_evacuation_by_imaging (Rao 2016 Rome IV F3 functional defecation disorders)",
                  "rome_iv_functional_defecation": true
                },
                {
                  "citation": {
                    "authors": "Rao SSC, Bharucha AE, Chiarioni G, Felt-Bersma R, Knowles C, Malcolm A, Wald A",
                    "doi": "10.1053/j.gastro.2016.02.009",
                    "id": "rao-2016",
                    "pmid": "27144630",
                    "source": "Gastroenterology. 2016;150(6):1430-1442",
                    "title": "Anorectal Disorders"
                  },
                  "criteria": [
                    {
                      "factor": "satisfies_fc_and_or_ibs_with_constipation",
                      "met": true
                    },
                    {
                      "factor": "abnormal_balloon_expulsion",
                      "met": true
                    },
                    {
                      "factor": "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                      "met": true
                    },
                    {
                      "factor": "impaired_rectal_evacuation_by_imaging",
                      "met": false
                    },
                    {
                      "factor": "fulfilled_last_3_months",
                      "met": true
                    },
                    {
                      "factor": "onset_at_least_6_months",
                      "met": true
                    },
                    {
                      "factor": "evacuation_tests_ge_2",
                      "met": true,
                      "value": 2
                    }
                  ],
                  "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.",
                  "evacuation_tests_met": 2,
                  "formula": "rome_iv_functional_defecation",
                  "formula_expression": "rome_iv_functional_defecation iff satisfies_fc_and_or_ibs_with_constipation and evacuation_tests_met >= 2 and fulfilled_last_3_months and onset_at_least_6_months; evacuation_tests_met counts abnormal_balloon_expulsion, abnormal_anorectal_evacuation_pattern_manometry_or_emg, and impaired_rectal_evacuation_by_imaging (Rao 2016 Rome IV F3 functional defecation disorders)",
                  "rome_iv_functional_defecation": true
                }
              ],
              "path": "/api/calc/rome_iv_functional_defecation"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "abnormal_anorectal_evacuation_pattern_manometry_or_emg": {
                            "description": "Abnormal anorectal evacuation pattern with manometry or anal surface EMG (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform manometry or EMG.",
                            "type": "boolean"
                          },
                          "abnormal_balloon_expulsion": {
                            "description": "Abnormal balloon expulsion test (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform balloon expulsion.",
                            "type": "boolean"
                          },
                          "fulfilled_last_3_months": {
                            "description": "Criteria fulfilled for the last 3 months, as assigned (Rao 2016). true or false as assigned by the caller. magent does not take a history.",
                            "type": "boolean"
                          },
                          "impaired_rectal_evacuation_by_imaging": {
                            "description": "Impaired rectal evacuation by imaging (one of three evacuation tests; at least two required). true or false as assigned by the caller. magent does not perform imaging.",
                            "type": "boolean"
                          },
                          "onset_at_least_6_months": {
                            "description": "Symptom onset at least 6 months prior to diagnosis, as assigned (Rao 2016). true or false as assigned by the caller. magent does not take a history.",
                            "type": "boolean"
                          },
                          "satisfies_fc_and_or_ibs_with_constipation": {
                            "description": "The patient already satisfies diagnostic criteria for functional constipation and/or IBS with constipation, as assigned (Rao 2016 F3). true or false as assigned by the caller. magent does not re-run those tools.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "satisfies_fc_and_or_ibs_with_constipation",
                          "abnormal_balloon_expulsion",
                          "abnormal_anorectal_evacuation_pattern_manometry_or_emg",
                          "impaired_rectal_evacuation_by_imaging",
                          "fulfilled_last_3_months",
                          "onset_at_least_6_months"
                        ],
                        "type": "object"
                      },
                      "maxItems": 25,
                      "minItems": 1,
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "method": {
                  "const": "POST",
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.magentlab.com",
    "manifest_name": "api.magentlab.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}