{
  "openapi": "3.1.0",
  "info": {
    "title": "clearcut. — Grocery Packaging Truth, Corporate Ownership & FDA Recall Oracle",
    "version": "2.4.0",
    "description": "Primary-record packaging verification across 471,605 U.S. grocery, beverage, supplement, and pet-food products. Deterministic 21 CFR § 101.4 / § 101.9 audits, M&A ownership graph, live FDA Breaking RSS + openFDA Class I/II recalls, and store-matched swaps. 0% brand sponsorships. Educational disclosures—not medical advice.",
    "contact": {
      "name": "clearcut. Partner & MCP Support",
      "url": "https://github.com/ethanalfert/clearcut-mcp/issues"
    }
  },
  "servers": [
    {
      "url": "https://clearcut.info",
      "description": "Production Read-Only Edge Oracle"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchProducts",
        "summary": "Search 471,605 U.S. foods & pet products by name or 8-14 digit UPC",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "minLength": 2, "maxLength": 120 },
            "description": "Product name, brand + product, or 8-14 digit UPC/EAN barcode"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching primary-record dossiers with Truth Verdicts, Honest Labels, ownership, and swaps"
          }
        }
      }
    },
    "/api/prosecute_custom": {
      "post": {
        "operationId": "auditIngredientLabel",
        "summary": "Ephemeral 21 CFR § 101.4 / § 101.9 deterministic audit on any back-of-box ingredient string",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["ingredients"],
                "properties": {
                  "brand_name": { "type": "string" },
                  "product_name": { "type": "string" },
                  "ingredients": { "type": "string", "description": "Verbatim comma-separated ingredients string" },
                  "barcode": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Deterministic ephemeral Truth Verdict dossier (read-only against catalog)" },
          "422": { "description": "Rejected unreadable OCR gibberish or Nutrition Facts table" }
        }
      }
    },
    "/item/{id}.json": {
      "get": {
        "operationId": "getProductDossierJson",
        "summary": "Fetch canonical machine-readable JSON dossier for a specific product ID or slug",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": { "description": "Structured Truth Dossier JSON (append .md for Markdown)" },
          "404": { "description": "Product not found" }
        }
      }
    },
    "/recalls.json": {
      "get": {
        "operationId": "getLiveFdaRecalls",
        "summary": "Live merged FDA Breaking Recalls RSS + openFDA Class I & II grocery and pet-food enforcement alerts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "maxLength": 80 },
            "description": "Optional brand, firm, or product keyword filter"
          }
        ],
        "responses": {
          "200": { "description": "Deduplicated live federal recall feed with official fda.gov links" }
        }
      }
    },
    "/ownership/{slug}.json": {
      "get": {
        "operationId": "getCorporateOwnershipHub",
        "summary": "Corporate M&A buyout roster ('buyouts') or specific conglomerate portfolio (e.g., 'pepsico', 'mondelez', 'campbells', 'mars', 'nestle', 'hershey')",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": { "description": "Verified M&A buyout records, deal sizes, years, and flagship sibling brands" },
          "404": { "description": "Ownership hub not found" }
        }
      }
    },
    "/caught/{pattern}.json": {
      "get": {
        "operationId": "getCaughtPatternHub",
        "summary": "Pre-vetted primary-record discrepancy cohort",
        "parameters": [
          {
            "name": "pattern",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "index",
                "olive-oil-dilution",
                "protein-more-sugar",
                "fake-guacamole",
                "zero-cal-spray-math",
                "zero-cream-creamers",
                "collagen-protein-padding"
              ]
            }
          }
        ],
        "responses": {
          "200": { "description": "Verified primary-record discrepancy dataset with USDA/UPC citations" },
          "404": { "description": "Pattern hub not found" }
        }
      }
    },
    "/api/agent/cart": {
      "post": {
        "operationId": "auditShoppingCart",
        "summary": "Authenticated bulk cart audit (1-40 items/call, $0.05/cart) with Truth Verdicts, ownership rollups, and swaps",
        "security": [{ "ClearcutAgentKey": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["cart_items"],
                "properties": {
                  "cart_items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 40,
                    "items": { "type": "string" }
                  },
                  "store_preference": {
                    "type": "string",
                    "enum": ["amazon", "walmart", "target", "wholefoods", "costco", "kroger", "traderjoes", "aldi", "erewhon", "instacart", "chewy"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Cart Truth Verdict summary, parent rollups, and verified counterparts" },
          "401": { "description": "Valid X-Clearcut-Agent-Key required" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ClearcutAgentKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Clearcut-Agent-Key"
      }
    }
  }
}
