{
 "openapi": "3.1.0",
 "info": {
  "title": "MFG Calcs Manufacturing Data and Calculation API",
  "version": "1.0.0",
  "description": "The whole mfgcalcs.com platform over HTTP, keyless. 33 data endpoints serve live U.S. manufacturing intelligence: the effective calculated-duty index and estimate, per-family effective-rate gap and statutory duty-free line coverage, sourcing shifts and concentration, customs unit-value movers, the cost-pressure index and its diffusion, manufacturing PMI, state cost indices, the wage board, six-month forecasts with their own accuracy ledger, reshoring readiness and indexed break-even comparisons, and an exact linear-programming sourcing optimizer. Alongside them: 5,384 deterministic manufacturing calculators, one search across everything the site knows, and an answer endpoint that returns a scoped, source-dated answer or a structured clarification request for a natural-language question.\n\nEverything is computed from committed public data (USITC, BLS, EIA, Census, BEA) rather than a model, so identical inputs always return identical output. The trust surfaces are part of the API, not a footnote: /api/vintages recovers what any series said on a past date, /api/revisions records every restatement, /api/provenance publishes artifact hashes, and /api/receipts carries Ed25519 signatures. Free with attribution (CC BY 4.0) and no key, ever. An MCP server exposing the same engines as tools for AI agents is at https://www.mfgcalcs.com/api/mcp.\n\nVERSIONING: every path below is also served under /api/v1/ — e.g. https://www.mfgcalcs.com/api/v1/manufacturing-pmi. Prefer the /api/v1 form in code you intend to keep: v1's response shapes are frozen (fields keep their name, type and meaning; new fields may be added, so ignore unknown ones), and any breaking change ships as /api/v2 instead of altering v1. The unversioned paths are permanent aliases and will not be removed. Responses carry an X-API-Version header. See https://www.mfgcalcs.com/developers and docs/methodology/API_VERSIONING.md.",
  "contact": {
   "url": "https://www.mfgcalcs.com/contact-us"
  }
 },
 "servers": [
  {
   "url": "https://www.mfgcalcs.com"
  }
 ],
 "x-mfgcalcs-preview": {
  "status": "preview-not-published",
  "notice": "MCP 2.0 preview documentation. These tools require an explicitly enabled preview deployment; this inventory does not activate them or prove that a hosted endpoint supports them. Read that endpoint's discovery response before calling.",
  "metadata": "/mcp-preview.json",
  "schemaReference": "/openapi-mcp-preview.json",
  "examples": "/mcp-preview-examples.json"
 },
 "paths": {
  "/api/calc": {
   "get": {
    "operationId": "calc",
    "summary": "Search calculators, describe one, or run a calculation",
    "description": "Pass exactly one of: search (find calculators), describe (inspect a calculator's inputs), or tool (run it). When running, provide inputs as extra query parameters named by field key or slugified label; missing inputs use the calculator's documented defaults. Every input is validated against its documented min/max: a value outside them is a 400 with code INPUT_OUT_OF_RANGE naming the field, the bound and the value received. describe also marks any field whose documented minimum of 0 is really exclusive (requiresPositive) — measured by running the calculator with that field at zero.",
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Find calculators, e.g. search=oee"
     },
     {
      "name": "describe",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Calculator slug to inspect, e.g. describe=unit-cost"
     },
     {
      "name": "tool",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Calculator slug to run, e.g. tool=oee"
     },
     {
      "name": "explain",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "checks",
        "trace"
       ]
      },
      "description": "Run responses only: explain=checks adds derivation.checks, the structured record of every reviewed cross-field rule and whether it held. explain=trace includes those checks plus executionTrace: accepted inputs and units, actual engine arguments, executed expressions where available, raw output outcomes and API rounding. Internal arithmetic steps are not captured. Both are opt-in; the default response and frozen MCP 1.0.0 run_calculator payload stay compatible."
     }
    ],
    "responses": {
     "200": {
      "description": "Search results, calculator description, or labeled calculation results with units, formula, and citation URL. A run also carries `derivation`, whose `confidence` describes the OUTPUT: \"none\" whenever any result row could not be computed (with `uncomputableResults` naming the row and the zero input responsible), otherwise high/medium/low by how much was assumed. The schema discriminates the three shapes; the examples below are real engine output and are validated against this schema in tests.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "One of three shapes, discriminated by the request: search results (search=), a calculator description (describe=), or a run (tool=) with labeled results. Validation failures are 400s with INVALID_CALCULATOR_INPUTS, INPUT_OUT_OF_RANGE, CONFLICTING_INPUT_ALIASES or INCONSISTENT_INPUTS, never a computed result.",
         "properties": {
          "query": {
           "type": "string",
           "description": "Search responses: the bounded query that ran."
          },
          "count": {
           "type": "integer",
           "description": "Search responses: number of matches returned."
          },
          "results": {
           "type": "array",
           "description": "Search matches (with search) or labeled result rows with units (with tool).",
           "items": {
            "anyOf": [
             {
              "type": "object",
              "required": [
               "tool",
               "name",
               "category",
               "description",
               "url",
               "run"
              ],
              "properties": {
               "tool": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "category": {
                "type": "string"
               },
               "description": {
                "type": "string"
               },
               "url": {
                "type": "string",
                "description": "Canonical calculator page to cite (CC BY 4.0 attribution)."
               },
               "run": {
                "type": "string",
                "description": "URL that runs this calculator with its documented defaults."
               }
              }
             },
             {
              "type": "object",
              "required": [
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "label": {
                "type": "string"
               },
               "value": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Null only when the row cannot be computed from the given inputs; confidence is then 'none' and derivation.uncomputableResults names the zero responsible."
               },
               "unit": {
                "type": "string"
               },
               "headline": {
                "type": "boolean",
                "description": "True for the row the calculator presents as its answer."
               }
              }
             }
            ]
           }
          },
          "tool": {
           "type": "string",
           "description": "Run/describe responses: the registry slug."
          },
          "name": {
           "type": "string"
          },
          "category": {
           "type": "string"
          },
          "description": {
           "type": "string",
           "description": "Describe responses only."
          },
          "useCase": {
           "type": "string",
           "description": "Describe responses only."
          },
          "notes": {
           "type": "object",
           "description": "Describe responses only: optional what/when/limits notes."
          },
          "url": {
           "type": "string",
           "description": "Canonical calculator page, for citation."
          },
          "inputs": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "key",
             "param",
             "label",
             "unit"
            ],
            "properties": {
             "key": {
              "type": "string",
              "description": "Canonical input key."
             },
             "param": {
              "type": "string",
              "description": "Preferred query-parameter name."
             },
             "label": {
              "type": "string"
             },
             "unit": {
              "type": "string"
             },
             "value": {
              "type": "number",
              "description": "Run responses only: the numeric value used, whether caller-supplied or the documented default."
             },
             "source": {
              "type": "string",
              "enum": [
               "input",
               "default"
              ],
              "description": "Run responses only: whether the caller supplied this value or the calculator's documented default was used."
             },
             "default": {
              "type": "string",
              "description": "Describe responses only: the documented default, as a string."
             },
             "min": {
              "type": "number"
             },
             "max": {
              "type": "number"
             },
             "requiresPositive": {
              "type": "boolean",
              "description": "Describe responses only: documented minimum is 0, but a value of 0 leaves a result row uncomputable."
             },
             "requiresPositiveNote": {
              "type": "string"
             },
             "wholeNumber": {
              "type": "boolean",
              "description": "Describe responses only: value must be an integer (a count)."
             },
             "legacyAliases": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "description": "Old parameter names that still bind to this input."
             },
             "hint": {
              "type": "string"
             }
            }
           },
           "description": "Run responses: the values used, each marked input or default. Describe responses: the declared fields with defaults and bounds."
          },
          "formula": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "release": {
           "type": "string",
           "description": "Present for next-generation (V2) calculators."
          },
          "issues": {
           "type": "array",
           "items": {
            "type": "object"
           },
           "description": "V2 calculators only: calculation issues with code, severity and message."
          },
          "assessment": {
           "type": "object",
           "description": "V2 calculators only: blocked/warning/clear plus a note."
          },
          "derivation": {
           "type": "object",
           "required": [
            "formula",
            "providedInputs",
            "assumedDefaults",
            "inputCount",
            "assumedCount",
            "reproduceUrl",
            "note",
            "confidence",
            "confidenceBasis"
           ],
           "properties": {
            "formula": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "providedInputs": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": "string"
               }
              }
             }
            },
            "assumedDefaults": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": "string"
               }
              }
             }
            },
            "inputCount": {
             "type": "integer"
            },
            "assumedCount": {
             "type": "integer"
            },
            "reproduceUrl": {
             "type": "string",
             "description": "Re-running this URL reproduces the result exactly, defaults included."
            },
            "note": {
             "type": "string"
            },
            "confidence": {
             "type": "string",
             "enum": [
              "none",
              "high",
              "medium",
              "low"
             ],
             "description": "Grades the OUTPUT, not the input: 'none' whenever a result row is uncomputable or a blocking issue exists; otherwise by how many inputs were assumed."
            },
            "confidenceBasis": {
             "type": "string"
            },
            "checks": {
             "type": "object",
             "description": "Structured completeness record, present when the run requested explain=checks or explain=trace. relationshipRules lists every reviewed cross-field rule for the slug with whether it held; a successful response contains only passed entries, and an explicit empty list means the slug has no reviewed relationship rule.",
             "properties": {
              "relationshipRules": {
               "type": "array",
               "items": {
                "type": "object",
                "required": [
                 "code",
                 "passed"
                ],
                "properties": {
                 "code": {
                  "type": "string"
                 },
                 "passed": {
                  "type": "boolean"
                 }
                }
               }
              }
             }
            },
            "uncomputableResults": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "label",
               "unit",
               "reason"
              ],
              "properties": {
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "reason": {
                "type": "string"
               },
               "raiseAboveZero": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          },
          "executionTrace": {
           "type": "object",
           "description": "Optional run disclosure requested with explain=trace. Records accepted inputs, actual engine arguments and returned rows before API serialization. Formula/template expressions are actual evaluator arguments; code engines have null expressions. Internal arithmetic steps, branch decisions and engine-specific rounding are not captured. Source references and documented formulas do not independently verify the model or authenticate a historical runtime.",
           "required": [
            "schemaVersion",
            "tool",
            "name",
            "engine",
            "method",
            "inputs",
            "operands",
            "outputs",
            "internalSteps",
            "limits"
           ],
           "properties": {
            "schemaVersion": {
             "type": "string",
             "const": "mfgcalcs.calculator-execution-trace.v1"
            },
            "tool": {
             "type": "string",
             "description": "Executed registry slug."
            },
            "name": {
             "type": "string"
            },
            "engine": {
             "type": "string",
             "enum": [
              "registry-template",
              "registry-formula",
              "calculator-code"
             ]
            },
            "method": {
             "type": "object",
             "required": [
              "registryRef",
              "evaluatorRef",
              "inputPolicyRef",
              "resultNormalizationRef",
              "formulaVersion",
              "contentVersion",
              "workbookVersion",
              "documentedFormulas"
             ],
             "properties": {
              "registryRef": {
               "type": "string",
               "description": "Registry source reference, not a content hash."
              },
              "evaluatorRef": {
               "type": "string",
               "description": "Actual evaluator or code dispatch reference."
              },
              "inputPolicyRef": {
               "type": "string",
               "const": "api/calc.ts#runCalculator"
              },
              "resultNormalizationRef": {
               "type": "string",
               "const": "api/calc.ts#sanitize"
              },
              "formulaVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "contentVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "workbookVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "documentedFormulas": {
               "type": "array",
               "items": {
                "type": "string"
               },
               "description": "Explanatory registry text, distinct from observed executable expressions."
              }
             }
            },
            "inputs": {
             "type": "array",
             "description": "Accepted values in their declared units, before engine-specific normalization.",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "unit",
               "value",
               "source"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "source": {
                "type": "string",
                "enum": [
                 "input",
                 "default"
                ]
               }
              }
             }
            },
            "operands": {
             "type": "array",
             "description": "Arguments at dispatch: after existing template normalization, or the arguments passed to the formula/code engine. Does not disclose transformations inside a code engine.",
             "items": {
              "type": "object",
              "required": [
               "key",
               "value",
               "unit",
               "declaredInput"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "declaredInput": {
                "type": "boolean",
                "description": "False for template slots supplied as zero constants rather than declared inputs."
               }
              }
             }
            },
            "outputs": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "index",
               "label",
               "unit",
               "headline",
               "expression",
               "rawValue",
               "rawOutcome",
               "value",
               "serialization"
              ],
              "properties": {
               "index": {
                "type": "integer",
                "minimum": 0
               },
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "headline": {
                "type": "boolean"
               },
               "expression": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "Exact formula/template evaluator expression; null when code was executed, even if a workbook expression exists."
               },
               "rawValue": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Finite engine output before API serialization; null for nonfinite output. Not an arbitrary-precision value or a record of internal rounding."
               },
               "rawOutcome": {
                "type": "string",
                "enum": [
                 "finite",
                 "not-a-number",
                 "positive-infinity",
                 "negative-infinity"
                ]
               },
               "value": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Published result after API serialization."
               },
               "serialization": {
                "type": "string",
                "enum": [
                 "nonfinite-to-null",
                 "Math.round(value * 1e6) / 1e6",
                 "finite-value-preserved-to-avoid-rounding-overflow"
                ]
               }
              }
             }
            },
            "internalSteps": {
             "type": "string",
             "const": "not-captured"
            },
            "limits": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           }
          },
          "attribution": {
           "type": "string",
           "description": "Run responses: the attribution line to cite."
          },
          "license": {
           "type": "string"
          },
          "sponsor": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "url": {
             "type": "string"
            }
           }
          },
          "workbook": {
           "type": "string",
           "description": "Describe responses: the canonical /api/workbook/<slug>.xlsx download for this calculator."
          },
          "versions": {
           "type": "object",
           "description": "Describe responses for V2 calculators: formula, content and workbook versions."
          },
          "methodology": {
           "type": "object",
           "description": "Describe responses for V2 calculators: method notes, assumptions, limitations and sources."
          }
         },
         "oneOf": [
          {
           "required": [
            "query",
            "count",
            "results"
           ]
          },
          {
           "required": [
            "tool",
            "name",
            "description",
            "useCase",
            "url",
            "inputs",
            "workbook"
           ]
          },
          {
           "required": [
            "tool",
            "name",
            "url",
            "inputs",
            "results",
            "derivation"
           ]
          }
         ]
        },
        "examples": {
         "run break-even quantity": {
          "value": {
           "tool": "break-even-quantity",
           "name": "Break-Even Quantity",
           "category": "Costing",
           "url": "https://www.mfgcalcs.com/calculators/lean-manufacturing-operations/break-even-quantity",
           "inputs": [
            {
             "key": "fixedCost",
             "param": "fixed-cost",
             "label": "Fixed Cost",
             "unit": "$",
             "value": 10000,
             "source": "input",
             "legacyAliases": [
              "fixedCost"
             ]
            },
            {
             "key": "variableCostPerUnit",
             "param": "variable-cost-per-unit",
             "label": "Variable Cost per Unit",
             "unit": "$ / unit",
             "value": 10,
             "source": "input",
             "legacyAliases": [
              "variableCost"
             ]
            },
            {
             "key": "sellingPricePerUnit",
             "param": "selling-price-per-unit",
             "label": "Selling Price per Unit",
             "unit": "$ / unit",
             "value": 15,
             "source": "input",
             "legacyAliases": [
              "price"
             ]
            },
            {
             "key": "targetVolumeUnits",
             "param": "target-volume",
             "label": "Target Volume",
             "unit": "units",
             "value": 3000,
             "source": "default",
             "legacyAliases": [
              "targetVolume"
             ]
            }
           ],
           "results": [
            {
             "label": "Break-Even Quantity",
             "value": 2000,
             "unit": "units",
             "headline": true
            },
            {
             "label": "Contribution Margin per Unit",
             "value": 5,
             "unit": "$ / unit"
            },
            {
             "label": "Break-Even Revenue",
             "value": 30000,
             "unit": "$"
            },
            {
             "label": "Profit at Target Volume",
             "value": 5000,
             "unit": "$"
            },
            {
             "label": "Margin of Safety",
             "value": 33.333333,
             "unit": "%"
            }
           ],
           "issues": [
            {
             "code": "clears-break-even",
             "severity": "info",
             "message": "Target volume of 3,000 units clears the 2,000 unit break-even by 1,000 units, a margin of safety of 33.3%. Profit at that volume is $5,000.",
             "inputKeys": [
              "targetVolumeUnits"
             ]
            }
           ],
           "assessment": {
            "status": "clear",
            "note": "Review the reported calculator issues and model limitations. The implemented checks do not certify process suitability."
           },
           "formula": [
            "Contribution margin = selling price − variable cost per unit",
            "Break-even units = fixed cost ÷ contribution margin",
            "Break-even revenue = break-even units × selling price",
            "Profit at target volume = contribution margin × target volume − fixed cost",
            "Margin of safety = (target volume − break-even units) ÷ target volume × 100"
           ],
           "release": "v2",
           "registryExecutionMethod": {
            "schemaVersion": "mfgcalcs.registry-execution-method.v1",
            "tool": "break-even-quantity",
            "name": "Break-Even Quantity",
            "path": "/calculators/lean-manufacturing-operations/break-even-quantity",
            "kind": "formula",
            "release": "v2",
            "preset": null,
            "formulaVersion": "beq-011-formula-2.0.0",
            "contentVersion": "beq-011-content-2.0.0",
            "workbookVersion": "beq-011-workbook-2.0.0",
            "fields": [
             {
              "key": "fixedCost",
              "label": "Fixed Cost",
              "unit": "$",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "variableCostPerUnit",
              "label": "Variable Cost per Unit",
              "unit": "$ / unit",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "sellingPricePerUnit",
              "label": "Selling Price per Unit",
              "unit": "$ / unit",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "targetVolumeUnits",
              "label": "Target Volume",
              "unit": "units",
              "min": 1,
              "max": null,
              "normalization": "preserve"
             }
            ],
            "rows": [
             {
              "index": 0,
              "label": "Break-Even Quantity",
              "unit": "units",
              "unitRule": "declared",
              "expression": "IF(({targetVolumeUnits}>=1),IF(({targetVolumeUnits}=FLOOR({targetVolumeUnits},1)),IF(({sellingPricePerUnit}>=0),IF(({variableCostPerUnit}>=0),IF(({fixedCost}>=0),IF((({sellingPricePerUnit}-{variableCostPerUnit})>0),IF(({sellingPricePerUnit}-{variableCostPerUnit})<>0,{fixedCost}/({sellingPricePerUnit}-{variableCostPerUnit}),0),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "fixedCost",
               "sellingPricePerUnit",
               "targetVolumeUnits",
               "variableCostPerUnit"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 1,
              "label": "Contribution Margin per Unit",
              "unit": "$ / unit",
              "unitRule": "declared",
              "expression": "IF(({targetVolumeUnits}>=1),IF(({targetVolumeUnits}=FLOOR({targetVolumeUnits},1)),IF(({sellingPricePerUnit}>=0),IF(({variableCostPerUnit}>=0),IF(({fixedCost}>=0),IF((({sellingPricePerUnit}-{variableCostPerUnit})>0),({sellingPricePerUnit}-{variableCostPerUnit}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "fixedCost",
               "sellingPricePerUnit",
               "targetVolumeUnits",
               "variableCostPerUnit"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 2,
              "label": "Break-Even Revenue",
              "unit": "$",
              "unitRule": "declared",
              "expression": "IF(({targetVolumeUnits}>=1),IF(({targetVolumeUnits}=FLOOR({targetVolumeUnits},1)),IF(({sellingPricePerUnit}>=0),IF(({variableCostPerUnit}>=0),IF(({fixedCost}>=0),IF((({sellingPricePerUnit}-{variableCostPerUnit})>0),(IF(({sellingPricePerUnit}-{variableCostPerUnit})<>0,{fixedCost}/({sellingPricePerUnit}-{variableCostPerUnit}),0)*{sellingPricePerUnit}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "fixedCost",
               "sellingPricePerUnit",
               "targetVolumeUnits",
               "variableCostPerUnit"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 3,
              "label": "Profit at Target Volume",
              "unit": "$",
              "unitRule": "declared",
              "expression": "IF(({targetVolumeUnits}>=1),IF(({targetVolumeUnits}=FLOOR({targetVolumeUnits},1)),IF(({sellingPricePerUnit}>=0),IF(({variableCostPerUnit}>=0),IF(({fixedCost}>=0),IF((({sellingPricePerUnit}-{variableCostPerUnit})>0),((({sellingPricePerUnit}-{variableCostPerUnit})*{targetVolumeUnits})-{fixedCost}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "fixedCost",
               "sellingPricePerUnit",
               "targetVolumeUnits",
               "variableCostPerUnit"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 4,
              "label": "Margin of Safety",
              "unit": "%",
              "unitRule": "declared",
              "expression": "IF(({targetVolumeUnits}>=1),IF(({targetVolumeUnits}=FLOOR({targetVolumeUnits},1)),IF(({sellingPricePerUnit}>=0),IF(({variableCostPerUnit}>=0),IF(({fixedCost}>=0),IF((({sellingPricePerUnit}-{variableCostPerUnit})>0),(IF({targetVolumeUnits}<>0,({targetVolumeUnits}-IF(({sellingPricePerUnit}-{variableCostPerUnit})<>0,{fixedCost}/({sellingPricePerUnit}-{variableCostPerUnit}),0))/{targetVolumeUnits},0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "fixedCost",
               "sellingPricePerUnit",
               "targetVolumeUnits",
               "variableCostPerUnit"
              ],
              "constants": {},
              "templateIndex": null
             }
            ]
           },
           "derivation": {
            "formula": [
             "Contribution margin = selling price − variable cost per unit",
             "Break-even units = fixed cost ÷ contribution margin",
             "Break-even revenue = break-even units × selling price",
             "Profit at target volume = contribution margin × target volume − fixed cost",
             "Margin of safety = (target volume − break-even units) ÷ target volume × 100"
            ],
            "providedInputs": [
             {
              "key": "fixedCost",
              "label": "Fixed Cost",
              "value": 10000,
              "unit": "$"
             },
             {
              "key": "variableCostPerUnit",
              "label": "Variable Cost per Unit",
              "value": 10,
              "unit": "$ / unit"
             },
             {
              "key": "sellingPricePerUnit",
              "label": "Selling Price per Unit",
              "value": 15,
              "unit": "$ / unit"
             }
            ],
            "assumedDefaults": [
             {
              "key": "targetVolumeUnits",
              "label": "Target Volume",
              "value": 3000,
              "unit": "units"
             }
            ],
            "inputCount": 4,
            "assumedCount": 1,
            "reproduceUrl": "https://www.mfgcalcs.com/api/v1/calc/break-even-quantity?fixed-cost=10000&variable-cost-per-unit=10&selling-price-per-unit=15&target-volume=3000",
            "note": "1 of 4 inputs used MFG Calcs' documented defaults rather than supplied values. State those assumptions when quoting this result.",
            "confidence": "medium",
            "confidenceBasis": "1 of 4 inputs were assumed; every result row computed."
           },
           "attribution": "Calculation by MFG Calcs: https://www.mfgcalcs.com/calculators/lean-manufacturing-operations/break-even-quantity",
           "license": "Free to use with attribution. Results are engineering estimates; verify against your own process data."
          }
         },
         "search oee": {
          "value": {
           "query": "oee",
           "count": 3,
           "results": [
            {
             "tool": "oee",
             "name": "OEE",
             "category": "Production",
             "description": "Availability, performance and quality against a target, with the run time and gap that separate a line from the OEE it wants.",
             "url": "https://www.mfgcalcs.com/calculators/conveyors-production-lines/oee",
             "run": "https://www.mfgcalcs.com/api/calc?tool=oee",
             "canonicalEntityId": "calculator:oee",
             "reason": "Exact title match",
             "readiness": {
              "schemaVersion": "mfgcalcs.discovery-readiness.v1",
              "state": "discoverable",
              "reasonCode": "catalog-only",
              "reason": "A published reference is available. Runtime support, authorization, live health and input readiness have not been established.",
              "basis": "catalog",
              "inputReview": "not-established",
              "executionAuthority": "none",
              "support": [
               {
                "schemaVersion": "mfgcalcs.discovery-support.v1",
                "capabilityId": "calculator.calculate",
                "capabilityVersion": "2.0.0",
                "publishedCapabilityVersion": "2.0.0",
                "basis": "catalog",
                "versions": {
                 "registry": "2.0.0",
                 "publication": "3a6ddce921cd1bb53fd9c7fa74fd051f3521e1d2871f2e92f372d32d051c5d69",
                 "ranking": "fielded-lexical-catalog-v5",
                 "code": "769cf4ba37250ed8c9233d90e67af566ad55884a"
                },
                "inputSchemaRef": "/schemas/calculator-calculate-input-v2.schema.json",
                "outputSchemaRef": "/schemas/mfgcalcs-result-v2.schema.json",
                "evidencePolicy": "calculation-receipt-required",
                "outputDeclaration": null,
                "requiredInputFields": null,
                "limitations": [],
                "unverifiedConstraintFields": [],
                "constraintCoverage": "declared-only",
                "executionValidation": "required",
                "executionAuthority": "none"
               }
              ]
             }
            },
            {
             "tool": "pultrusion-continuous-composite-profiles-line-oee",
             "name": "Line OEE",
             "category": "Pultrusion & Continuous Composite Profiles",
             "description": "Line OEE (Overall Equipment Effectiveness) measures how much of a pultrusion line's planned time actually produces good profile at rated speed.",
             "url": "https://www.mfgcalcs.com/calculators/pultrusion-continuous-composite-profiles/line-oee",
             "run": "https://www.mfgcalcs.com/api/calc?tool=pultrusion-continuous-composite-profiles-line-oee",
             "canonicalEntityId": "calculator:pultrusion-continuous-composite-profiles-line-oee",
             "reason": "Title matches: oee · Published alias: oee",
             "readiness": {
              "schemaVersion": "mfgcalcs.discovery-readiness.v1",
              "state": "discoverable",
              "reasonCode": "catalog-only",
              "reason": "A published reference is available. Runtime support, authorization, live health and input readiness have not been established.",
              "basis": "catalog",
              "inputReview": "not-established",
              "executionAuthority": "none",
              "support": [
               {
                "schemaVersion": "mfgcalcs.discovery-support.v1",
                "capabilityId": "calculator.calculate",
                "capabilityVersion": "2.0.0",
                "publishedCapabilityVersion": "2.0.0",
                "basis": "catalog",
                "versions": {
                 "registry": "2.0.0",
                 "publication": "3a6ddce921cd1bb53fd9c7fa74fd051f3521e1d2871f2e92f372d32d051c5d69",
                 "ranking": "fielded-lexical-catalog-v5",
                 "code": "769cf4ba37250ed8c9233d90e67af566ad55884a"
                },
                "inputSchemaRef": "/schemas/calculator-calculate-input-v2.schema.json",
                "outputSchemaRef": "/schemas/mfgcalcs-result-v2.schema.json",
                "evidencePolicy": "calculation-receipt-required",
                "outputDeclaration": null,
                "requiredInputFields": null,
                "limitations": [],
                "unverifiedConstraintFields": [],
                "constraintCoverage": "declared-only",
                "executionValidation": "required",
                "executionAuthority": "none"
               }
              ]
             }
            },
            {
             "tool": "packaging-automation-oee",
             "name": "Packaging Automation OEE",
             "category": "Packaging Automation & End-of-Line Systems",
             "description": "Calculate packaging OEE from recorded availability, running performance and first-pass quality.",
             "url": "https://www.mfgcalcs.com/calculators/packaging-automation-end-of-line-systems/packaging-automation-oee",
             "run": "https://www.mfgcalcs.com/api/calc?tool=packaging-automation-oee",
             "canonicalEntityId": "calculator:packaging-automation-oee",
             "reason": "Title matches: oee · Published alias: oee",
             "readiness": {
              "schemaVersion": "mfgcalcs.discovery-readiness.v1",
              "state": "discoverable",
              "reasonCode": "catalog-only",
              "reason": "A published reference is available. Runtime support, authorization, live health and input readiness have not been established.",
              "basis": "catalog",
              "inputReview": "not-established",
              "executionAuthority": "none",
              "support": [
               {
                "schemaVersion": "mfgcalcs.discovery-support.v1",
                "capabilityId": "calculator.calculate",
                "capabilityVersion": "2.0.0",
                "publishedCapabilityVersion": "2.0.0",
                "basis": "catalog",
                "versions": {
                 "registry": "2.0.0",
                 "publication": "3a6ddce921cd1bb53fd9c7fa74fd051f3521e1d2871f2e92f372d32d051c5d69",
                 "ranking": "fielded-lexical-catalog-v5",
                 "code": "769cf4ba37250ed8c9233d90e67af566ad55884a"
                },
                "inputSchemaRef": "/schemas/calculator-calculate-input-v2.schema.json",
                "outputSchemaRef": "/schemas/mfgcalcs-result-v2.schema.json",
                "evidencePolicy": "calculation-receipt-required",
                "outputDeclaration": null,
                "requiredInputFields": null,
                "limitations": [],
                "unverifiedConstraintFields": [],
                "constraintCoverage": "declared-only",
                "executionValidation": "required",
                "executionAuthority": "none"
               }
              ]
             }
            }
           ],
           "discovery": {
            "schemaVersion": "mfgcalcs.calculator-discovery.v1",
            "ranking": "fielded-lexical-catalog-v5",
            "publication": "3a6ddce921cd1bb53fd9c7fa74fd051f3521e1d2871f2e92f372d32d051c5d69",
            "registry": "2.0.0",
            "code": "769cf4ba37250ed8c9233d90e67af566ad55884a",
            "indexSource": "published-postings",
            "coverage": "registered-calculators-only",
            "corpusCount": 5384,
            "metadataMatched": 5384,
            "publicationSource": "769cf4ba37250ed8c9233d90e67af566ad55884a",
            "manifestSha256": "906f47c5a3aecdc4fbfd032c4b96353821badc68ca17568584a82431e60f6fcb",
            "lexicalArtifact": "3fd61ad5d55732b159fe8dc8b3624eb7b3c064a2b94587fc3cc43300821793b6",
            "totalMatches": 66,
            "excludedCandidateCount": 0,
            "constraints": [],
            "unconfirmedConstraintFields": [],
            "warnings": [],
            "executionAuthority": "none",
            "returnedCount": 3,
            "hasMore": true
           }
          }
         },
         "describe oee": {
          "value": {
           "tool": "oee",
           "name": "OEE",
           "category": "Production",
           "description": "Availability, performance and quality against a target, with the run time and gap that separate a line from the OEE it wants.",
           "useCase": "Use it for end-of-shift OEE review at the board, choosing which loss factor to attack, checking a shift against the OEE target.",
           "notes": {
            "what": "Availability, performance and quality against a target, with the run time and gap that separate a line from the OEE it wants.",
            "when": "Best suited to end-of-shift OEE review at the board, choosing which loss factor to attack, checking a shift against the OEE target.",
            "limits": "Counts give quality and performance at the line level, not per machine. Setups and changeovers count as downtime when they run inside planned time."
           },
           "url": "https://www.mfgcalcs.com/calculators/conveyors-production-lines/oee",
           "inputs": [
            {
             "key": "plannedMinutes",
             "param": "planned-production-time",
             "label": "Planned Production Time",
             "unit": "min",
             "default": "480",
             "min": 1,
             "max": 1440,
             "legacyAliases": [
              "plannedMinutes"
             ],
             "hint": "Scheduled production minutes for the window, before any stops."
            },
            {
             "key": "downtimeMinutes",
             "param": "downtime",
             "label": "Downtime",
             "unit": "min",
             "default": "55",
             "min": 0,
             "max": 1440,
             "legacyAliases": [
              "downtimeMinutes"
             ],
             "hint": "Stopped minutes inside planned time, from the downtime log."
            },
            {
             "key": "idealCycleSeconds",
             "param": "ideal-cycle-time",
             "label": "Ideal Cycle Time",
             "unit": "sec / unit",
             "default": "20",
             "min": 0,
             "legacyAliases": [
              "idealCycleSeconds"
             ],
             "hint": "Fastest sustained seconds per unit the line can hold."
            },
            {
             "key": "totalCount",
             "param": "total-count",
             "label": "Total Count",
             "unit": "units",
             "default": "1180",
             "min": 0,
             "requiresPositive": true,
             "requiresPositiveNote": "Documented minimum is 0, but a value of 0 leaves at least one result row uncomputable. Supply a value above 0.",
             "legacyAliases": [
              "totalCount"
             ],
             "hint": "All units produced in the window, scrap included."
            },
            {
             "key": "goodCount",
             "param": "good-count",
             "label": "Good Count",
             "unit": "units",
             "default": "1125",
             "min": 0,
             "legacyAliases": [
              "goodCount"
             ],
             "hint": "First-pass good units in the same window as total count."
            },
            {
             "key": "targetOeePct",
             "param": "target-oee",
             "label": "Target OEE",
             "unit": "%",
             "default": "85",
             "min": 0,
             "max": 100,
             "hint": "OEE the site expects this line or window to reach."
            }
           ],
           "formula": [
            "Run time = planned production time − downtime minutes",
            "Availability = run time ÷ planned production time; quality = good count ÷ total count",
            "Performance = ideal cycle seconds × total count ÷ (run time × 60)",
            "OEE = availability × performance × quality, or ideal cycle × good count ÷ (planned minutes × 60)",
            "Gap to target = OEE − target OEE"
           ],
           "release": "v2",
           "versions": {
            "formula": "oee-004-formula-2.0.0",
            "content": "oee-004-content-2.0.0",
            "workbook": "oee-004-workbook-2.0.0"
           },
           "methodology": {
            "methodNotes": [
             "Run time = planned production time − downtime minutes",
             "Availability = run time ÷ planned production time; quality = good count ÷ total count",
             "Performance = ideal cycle seconds × total count ÷ (run time × 60)",
             "OEE = availability × performance × quality, or ideal cycle × good count ÷ (planned minutes × 60)",
             "Gap to target = OEE − target OEE",
             "Counts and downtime come from the same planned production window.",
             "The ideal cycle is the fastest sustained cycle the line can hold.",
             "Counts give quality and performance at the line level, not per machine.",
             "Setups and changeovers count as downtime when they run inside planned time."
            ],
            "assumptions": [
             "Counts and downtime come from the same planned production window.",
             "The ideal cycle is the fastest sustained cycle the line can hold."
            ],
            "limitations": [
             "Counts give quality and performance at the line level, not per machine.",
             "Setups and changeovers count as downtime when they run inside planned time."
            ],
            "sources": [
             {
              "title": "Calculating OEE (OEE.com)",
              "url": "https://www.oee.com/calculating-oee/",
              "appliesTo": "OEE is availability times performance times quality, and the simple form is good count times ideal cycle time divided by planned production time."
             },
             {
              "title": "OEE Factors (OEE.com)",
              "url": "https://www.oee.com/oee-factors/",
              "appliesTo": "Availability is the ratio of run time to planned production time, and quality is the ratio of good count to total count."
             },
             {
              "title": "Overall equipment effectiveness (Wikipedia)",
              "url": "https://en.wikipedia.org/wiki/Overall_equipment_effectiveness",
              "appliesTo": "OEE measures the percentage of scheduled manufacturing time that is truly productive, with 100% meaning only good parts at maximum speed without interruption."
             }
            ]
           },
           "workbook": "https://www.mfgcalcs.com/api/workbook/oee.xlsx?v=2026-10-11.2"
          }
         },
         "run oee with execution trace": {
          "value": {
           "tool": "oee",
           "name": "OEE",
           "category": "Production",
           "url": "https://www.mfgcalcs.com/calculators/conveyors-production-lines/oee",
           "inputs": [
            {
             "key": "plannedMinutes",
             "param": "planned-production-time",
             "label": "Planned Production Time",
             "unit": "min",
             "value": 480,
             "source": "input",
             "legacyAliases": [
              "plannedMinutes"
             ]
            },
            {
             "key": "downtimeMinutes",
             "param": "downtime",
             "label": "Downtime",
             "unit": "min",
             "value": 30,
             "source": "input",
             "legacyAliases": [
              "downtimeMinutes"
             ]
            },
            {
             "key": "idealCycleSeconds",
             "param": "ideal-cycle-time",
             "label": "Ideal Cycle Time",
             "unit": "sec / unit",
             "value": 60,
             "source": "input",
             "legacyAliases": [
              "idealCycleSeconds"
             ]
            },
            {
             "key": "totalCount",
             "param": "total-count",
             "label": "Total Count",
             "unit": "units",
             "value": 400,
             "source": "input",
             "legacyAliases": [
              "totalCount"
             ]
            },
            {
             "key": "goodCount",
             "param": "good-count",
             "label": "Good Count",
             "unit": "units",
             "value": 390,
             "source": "input",
             "legacyAliases": [
              "goodCount"
             ]
            },
            {
             "key": "targetOeePct",
             "param": "target-oee",
             "label": "Target OEE",
             "unit": "%",
             "value": 85,
             "source": "default"
            }
           ],
           "results": [
            {
             "label": "OEE",
             "value": 81.25,
             "unit": "%",
             "headline": true
            },
            {
             "label": "Availability",
             "value": 93.75,
             "unit": "%"
            },
            {
             "label": "Performance",
             "value": 88.888889,
             "unit": "%"
            },
            {
             "label": "Quality",
             "value": 97.5,
             "unit": "%"
            },
            {
             "label": "Run Time",
             "value": 450,
             "unit": "min"
            },
            {
             "label": "Gap to Target",
             "value": -3.75,
             "unit": "points"
            }
           ],
           "executionTrace": {
            "schemaVersion": "mfgcalcs.calculator-execution-trace.v1",
            "tool": "oee",
            "name": "OEE",
            "engine": "registry-formula",
            "method": {
             "registryRef": "api/_calcRegistry.json#oee",
             "evaluatorRef": "src/lib/excelEval.ts#evaluateTemplate",
             "inputPolicyRef": "api/calc.ts#runCalculator",
             "resultNormalizationRef": "api/calc.ts#sanitize",
             "formulaVersion": "oee-004-formula-2.0.0",
             "contentVersion": "oee-004-content-2.0.0",
             "workbookVersion": "oee-004-workbook-2.0.0",
             "documentedFormulas": [
              "Run time = planned production time − downtime minutes",
              "Availability = run time ÷ planned production time; quality = good count ÷ total count",
              "Performance = ideal cycle seconds × total count ÷ (run time × 60)",
              "OEE = availability × performance × quality, or ideal cycle × good count ÷ (planned minutes × 60)",
              "Gap to target = OEE − target OEE"
             ]
            },
            "inputs": [
             {
              "key": "plannedMinutes",
              "label": "Planned Production Time",
              "unit": "min",
              "value": 480,
              "source": "input"
             },
             {
              "key": "downtimeMinutes",
              "label": "Downtime",
              "unit": "min",
              "value": 30,
              "source": "input"
             },
             {
              "key": "idealCycleSeconds",
              "label": "Ideal Cycle Time",
              "unit": "sec / unit",
              "value": 60,
              "source": "input"
             },
             {
              "key": "totalCount",
              "label": "Total Count",
              "unit": "units",
              "value": 400,
              "source": "input"
             },
             {
              "key": "goodCount",
              "label": "Good Count",
              "unit": "units",
              "value": 390,
              "source": "input"
             },
             {
              "key": "targetOeePct",
              "label": "Target OEE",
              "unit": "%",
              "value": 85,
              "source": "default"
             }
            ],
            "operands": [
             {
              "key": "plannedMinutes",
              "value": 480,
              "unit": "min",
              "declaredInput": true
             },
             {
              "key": "downtimeMinutes",
              "value": 30,
              "unit": "min",
              "declaredInput": true
             },
             {
              "key": "idealCycleSeconds",
              "value": 60,
              "unit": "sec / unit",
              "declaredInput": true
             },
             {
              "key": "totalCount",
              "value": 400,
              "unit": "units",
              "declaredInput": true
             },
             {
              "key": "goodCount",
              "value": 390,
              "unit": "units",
              "declaredInput": true
             },
             {
              "key": "targetOeePct",
              "value": 85,
              "unit": "%",
              "declaredInput": true
             }
            ],
            "outputs": [
             {
              "index": 0,
              "label": "OEE",
              "unit": "%",
              "headline": true,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF(({plannedMinutes}*60)<>0,({idealCycleSeconds}*{goodCount})/({plannedMinutes}*60),0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 81.25,
              "rawOutcome": "finite",
              "value": 81.25,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 1,
              "label": "Availability",
              "unit": "%",
              "headline": false,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF({plannedMinutes}<>0,({plannedMinutes}-{downtimeMinutes})/{plannedMinutes},0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 93.75,
              "rawOutcome": "finite",
              "value": 93.75,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 2,
              "label": "Performance",
              "unit": "%",
              "headline": false,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF((({plannedMinutes}-{downtimeMinutes})*60)<>0,({idealCycleSeconds}*{totalCount})/(({plannedMinutes}-{downtimeMinutes})*60),0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 88.88888888888889,
              "rawOutcome": "finite",
              "value": 88.888889,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 3,
              "label": "Quality",
              "unit": "%",
              "headline": false,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),IF(({goodCount}>{totalCount}),\"\",IF(({totalCount}>0),(IF({totalCount}<>0,{goodCount}/{totalCount},0)*100),\"\")),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 97.5,
              "rawOutcome": "finite",
              "value": 97.5,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 4,
              "label": "Run Time",
              "unit": "min",
              "headline": false,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),({plannedMinutes}-{downtimeMinutes}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 450,
              "rawOutcome": "finite",
              "value": 450,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 5,
              "label": "Gap to Target",
              "unit": "points",
              "headline": false,
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),((IF(({plannedMinutes}*60)<>0,({idealCycleSeconds}*{goodCount})/({plannedMinutes}*60),0)*100)-{targetOeePct}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": -3.75,
              "rawOutcome": "finite",
              "value": -3.75,
              "serialization": "Math.round(value * 1e6) / 1e6"
             }
            ],
            "internalSteps": "not-captured",
            "limits": [
             "This records the executed method, accepted inputs and returned rows; it is not independent verification of the model.",
             "Internal arithmetic steps and engine-specific rounding are not captured. Raw values are engine outputs before API serialization, not arbitrary-precision results.",
             "Expressions are the exact evaluator arguments; intermediate values and which conditional branches ran are not recorded."
            ]
           },
           "issues": [
            {
             "code": "below-oee-target",
             "severity": "warning",
             "message": "OEE of 81.25% is 3.75 points below the 85% target. Performance is the largest loss factor at 11.11 points.",
             "inputKeys": [
              "goodCount",
              "downtimeMinutes"
             ]
            }
           ],
           "assessment": {
            "status": "warning",
            "note": "Review the reported calculator issues and model limitations. The implemented checks do not certify process suitability."
           },
           "formula": [
            "Run time = planned production time − downtime minutes",
            "Availability = run time ÷ planned production time; quality = good count ÷ total count",
            "Performance = ideal cycle seconds × total count ÷ (run time × 60)",
            "OEE = availability × performance × quality, or ideal cycle × good count ÷ (planned minutes × 60)",
            "Gap to target = OEE − target OEE"
           ],
           "release": "v2",
           "registryExecutionMethod": {
            "schemaVersion": "mfgcalcs.registry-execution-method.v1",
            "tool": "oee",
            "name": "OEE",
            "path": "/calculators/conveyors-production-lines/oee",
            "kind": "formula",
            "release": "v2",
            "preset": null,
            "formulaVersion": "oee-004-formula-2.0.0",
            "contentVersion": "oee-004-content-2.0.0",
            "workbookVersion": "oee-004-workbook-2.0.0",
            "fields": [
             {
              "key": "plannedMinutes",
              "label": "Planned Production Time",
              "unit": "min",
              "min": 1,
              "max": 1440,
              "normalization": "preserve"
             },
             {
              "key": "downtimeMinutes",
              "label": "Downtime",
              "unit": "min",
              "min": 0,
              "max": 1440,
              "normalization": "preserve"
             },
             {
              "key": "idealCycleSeconds",
              "label": "Ideal Cycle Time",
              "unit": "sec / unit",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "totalCount",
              "label": "Total Count",
              "unit": "units",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "goodCount",
              "label": "Good Count",
              "unit": "units",
              "min": 0,
              "max": null,
              "normalization": "preserve"
             },
             {
              "key": "targetOeePct",
              "label": "Target OEE",
              "unit": "%",
              "min": 0,
              "max": 100,
              "normalization": "preserve"
             }
            ],
            "rows": [
             {
              "index": 0,
              "label": "OEE",
              "unit": "%",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF(({plannedMinutes}*60)<>0,({idealCycleSeconds}*{goodCount})/({plannedMinutes}*60),0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 1,
              "label": "Availability",
              "unit": "%",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF({plannedMinutes}<>0,({plannedMinutes}-{downtimeMinutes})/{plannedMinutes},0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 2,
              "label": "Performance",
              "unit": "%",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),(IF((({plannedMinutes}-{downtimeMinutes})*60)<>0,({idealCycleSeconds}*{totalCount})/(({plannedMinutes}-{downtimeMinutes})*60),0)*100),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 3,
              "label": "Quality",
              "unit": "%",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),IF(({goodCount}>{totalCount}),\"\",IF(({totalCount}>0),(IF({totalCount}<>0,{goodCount}/{totalCount},0)*100),\"\")),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 4,
              "label": "Run Time",
              "unit": "min",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),({plannedMinutes}-{downtimeMinutes}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 5,
              "label": "Gap to Target",
              "unit": "points",
              "unitRule": "declared",
              "expression": "IF(({targetOeePct}>=0),IF(({targetOeePct}<=100),IF(({goodCount}>=0),IF(({goodCount}=FLOOR({goodCount},1)),IF(({totalCount}>=0),IF(({totalCount}=FLOOR({totalCount},1)),IF(({idealCycleSeconds}>=0),IF(({downtimeMinutes}>=0),IF(({downtimeMinutes}<=1440),IF(({plannedMinutes}>=1),IF(({plannedMinutes}<=1440),IF((({plannedMinutes}-{downtimeMinutes})>0),IF(({goodCount}<=({totalCount}+1e-9)),IF((IF(60<>0,({idealCycleSeconds}*{totalCount})/60,0)<=(({plannedMinutes}-{downtimeMinutes})+1e-9)),((IF(({plannedMinutes}*60)<>0,({idealCycleSeconds}*{goodCount})/({plannedMinutes}*60),0)*100)-{targetOeePct}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "downtimeMinutes",
               "goodCount",
               "idealCycleSeconds",
               "plannedMinutes",
               "targetOeePct",
               "totalCount"
              ],
              "constants": {},
              "templateIndex": null
             }
            ]
           },
           "derivation": {
            "formula": [
             "Run time = planned production time − downtime minutes",
             "Availability = run time ÷ planned production time; quality = good count ÷ total count",
             "Performance = ideal cycle seconds × total count ÷ (run time × 60)",
             "OEE = availability × performance × quality, or ideal cycle × good count ÷ (planned minutes × 60)",
             "Gap to target = OEE − target OEE"
            ],
            "providedInputs": [
             {
              "key": "plannedMinutes",
              "label": "Planned Production Time",
              "value": 480,
              "unit": "min"
             },
             {
              "key": "downtimeMinutes",
              "label": "Downtime",
              "value": 30,
              "unit": "min"
             },
             {
              "key": "idealCycleSeconds",
              "label": "Ideal Cycle Time",
              "value": 60,
              "unit": "sec / unit"
             },
             {
              "key": "totalCount",
              "label": "Total Count",
              "value": 400,
              "unit": "units"
             },
             {
              "key": "goodCount",
              "label": "Good Count",
              "value": 390,
              "unit": "units"
             }
            ],
            "assumedDefaults": [
             {
              "key": "targetOeePct",
              "label": "Target OEE",
              "value": 85,
              "unit": "%"
             }
            ],
            "inputCount": 6,
            "assumedCount": 1,
            "reproduceUrl": "https://www.mfgcalcs.com/api/v1/calc/oee?planned-production-time=480&downtime=30&ideal-cycle-time=60&total-count=400&good-count=390&target-oee=85",
            "note": "1 of 6 inputs used MFG Calcs' documented defaults rather than supplied values. State those assumptions when quoting this result.",
            "confidence": "medium",
            "confidenceBasis": "1 of 6 inputs were assumed; every result row computed.",
            "checks": {
             "relationshipRules": [
              {
               "code": "oee-good-exceeds-total",
               "passed": true
              },
              {
               "code": "oee-downtime-exceeds-planned",
               "passed": true
              },
              {
               "code": "oee-production-exceeds-runtime",
               "passed": true
              }
             ]
            }
           },
           "attribution": "Calculation by MFG Calcs: https://www.mfgcalcs.com/calculators/conveyors-production-lines/oee",
           "license": "Free to use with attribution. Results are engineering estimates; verify against your own process data."
          }
         },
         "run template with execution trace": {
          "value": {
           "tool": "plastics-extrusion-pipe-film-profile-pipe-weight-per-foot",
           "name": "Pipe Weight per Foot",
           "category": "Plastics Extrusion - Pipe, Film & Profile",
           "url": "https://www.mfgcalcs.com/calculators/plastics-extrusion-pipe-film-profile/pipe-weight-per-foot",
           "inputs": [
            {
             "key": "outsideDiameterIn",
             "param": "finished-outside-diameter",
             "label": "Finished Outside Diameter",
             "unit": "in",
             "value": 2,
             "source": "input"
            },
            {
             "key": "insideDiameterIn",
             "param": "finished-inside-diameter",
             "label": "Finished Inside Diameter",
             "unit": "in",
             "value": 1.75,
             "source": "input"
            },
            {
             "key": "solidDensityLbPerIn3",
             "param": "solid-resin-density",
             "label": "Solid Resin Density",
             "unit": "lb/in³",
             "value": 0.034,
             "source": "input",
             "legacyAliases": [
              "b"
             ]
            }
           ],
           "results": [
            {
             "label": "Pipe Weight per Foot",
             "value": 0.300415,
             "unit": "lb/ft",
             "headline": true
            },
            {
             "label": "Pipe Wall Cross-Section Area",
             "value": 0.736311,
             "unit": "in²"
            },
            {
             "label": "Uniform Wall Thickness",
             "value": 0.125,
             "unit": "in"
            },
            {
             "label": "Mass per Inch",
             "value": 0.025035,
             "unit": "lb/in"
            }
           ],
           "executionTrace": {
            "schemaVersion": "mfgcalcs.calculator-execution-trace.v1",
            "tool": "plastics-extrusion-pipe-film-profile-pipe-weight-per-foot",
            "name": "Pipe Weight per Foot",
            "engine": "registry-formula",
            "method": {
             "registryRef": "api/_calcRegistry.json#plastics-extrusion-pipe-film-profile-pipe-weight-per-foot",
             "evaluatorRef": "src/lib/excelEval.ts#evaluateTemplate",
             "inputPolicyRef": "api/calc.ts#runCalculator",
             "resultNormalizationRef": "api/calc.ts#sanitize",
             "formulaVersion": "pex-012-formula-2.0.0",
             "contentVersion": "pex-012-content-2.0.0",
             "workbookVersion": "pex-012-workbook-2.0.0",
             "documentedFormulas": [
              "Wall area = π × (outside diameter² − inside diameter²) ÷ 4",
              "Pipe weight per foot = wall area × solid density × 12",
              "Uniform wall thickness = (outside diameter − inside diameter) ÷ 2",
              "Mass per inch = wall area × solid density"
             ]
            },
            "inputs": [
             {
              "key": "outsideDiameterIn",
              "label": "Finished Outside Diameter",
              "unit": "in",
              "value": 2,
              "source": "input"
             },
             {
              "key": "insideDiameterIn",
              "label": "Finished Inside Diameter",
              "unit": "in",
              "value": 1.75,
              "source": "input"
             },
             {
              "key": "solidDensityLbPerIn3",
              "label": "Solid Resin Density",
              "unit": "lb/in³",
              "value": 0.034,
              "source": "input"
             }
            ],
            "operands": [
             {
              "key": "outsideDiameterIn",
              "value": 2,
              "unit": "in",
              "declaredInput": true
             },
             {
              "key": "insideDiameterIn",
              "value": 1.75,
              "unit": "in",
              "declaredInput": true
             },
             {
              "key": "solidDensityLbPerIn3",
              "value": 0.034,
              "unit": "lb/in³",
              "declaredInput": true
             }
            ],
            "outputs": [
             {
              "index": 0,
              "label": "Pipe Weight per Foot",
              "unit": "lb/ft",
              "headline": true,
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),(((IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn})))*{solidDensityLbPerIn3})*12),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 0.3004147974995237,
              "rawOutcome": "finite",
              "value": 0.300415,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 1,
              "label": "Pipe Wall Cross-Section Area",
              "unit": "in²",
              "headline": false,
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),(IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn}))),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 0.736310778185107,
              "rawOutcome": "finite",
              "value": 0.736311,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 2,
              "label": "Uniform Wall Thickness",
              "unit": "in",
              "headline": false,
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),IF(2<>0,({outsideDiameterIn}-{insideDiameterIn})/2,0),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 0.125,
              "rawOutcome": "finite",
              "value": 0.125,
              "serialization": "Math.round(value * 1e6) / 1e6"
             },
             {
              "index": 3,
              "label": "Mass per Inch",
              "unit": "lb/in",
              "headline": false,
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),((IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn})))*{solidDensityLbPerIn3}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "rawValue": 0.02503456645829364,
              "rawOutcome": "finite",
              "value": 0.025035,
              "serialization": "Math.round(value * 1e6) / 1e6"
             }
            ],
            "internalSteps": "not-captured",
            "limits": [
             "This records the executed method, accepted inputs and returned rows; it is not independent verification of the model.",
             "Internal arithmetic steps and engine-specific rounding are not captured. Raw values are engine outputs before API serialization, not arbitrary-precision results.",
             "Expressions are the exact evaluator arguments; intermediate values and which conditional branches ran are not recorded."
            ]
           },
           "issues": [
            {
             "code": "pipe-weight-per-foot-verdict",
             "severity": "info",
             "message": "Calculated pipe weight is 0.3004 lb/ft from 0.7363 in² of wall area. Check the finished dimensions and compound density against a weighed sample."
            }
           ],
           "assessment": {
            "status": "clear",
            "note": "Review the reported calculator issues and model limitations. The implemented checks do not certify process suitability."
           },
           "formula": [
            "Wall area = π × (outside diameter² − inside diameter²) ÷ 4",
            "Pipe weight per foot = wall area × solid density × 12",
            "Uniform wall thickness = (outside diameter − inside diameter) ÷ 2",
            "Mass per inch = wall area × solid density"
           ],
           "release": "v2",
           "registryExecutionMethod": {
            "schemaVersion": "mfgcalcs.registry-execution-method.v1",
            "tool": "plastics-extrusion-pipe-film-profile-pipe-weight-per-foot",
            "name": "Pipe Weight per Foot",
            "path": "/calculators/plastics-extrusion-pipe-film-profile/pipe-weight-per-foot",
            "kind": "formula",
            "release": "v2",
            "preset": null,
            "formulaVersion": "pex-012-formula-2.0.0",
            "contentVersion": "pex-012-content-2.0.0",
            "workbookVersion": "pex-012-workbook-2.0.0",
            "fields": [
             {
              "key": "outsideDiameterIn",
              "label": "Finished Outside Diameter",
              "unit": "in",
              "min": 0.0001,
              "max": 1000,
              "normalization": "preserve"
             },
             {
              "key": "insideDiameterIn",
              "label": "Finished Inside Diameter",
              "unit": "in",
              "min": 0,
              "max": 1000,
              "normalization": "preserve"
             },
             {
              "key": "solidDensityLbPerIn3",
              "label": "Solid Resin Density",
              "unit": "lb/in³",
              "min": 0.000001,
              "max": 1,
              "normalization": "preserve"
             }
            ],
            "rows": [
             {
              "index": 0,
              "label": "Pipe Weight per Foot",
              "unit": "lb/ft",
              "unitRule": "declared",
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),(((IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn})))*{solidDensityLbPerIn3})*12),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "insideDiameterIn",
               "outsideDiameterIn",
               "solidDensityLbPerIn3"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 1,
              "label": "Pipe Wall Cross-Section Area",
              "unit": "in²",
              "unitRule": "declared",
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),(IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn}))),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "insideDiameterIn",
               "outsideDiameterIn",
               "solidDensityLbPerIn3"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 2,
              "label": "Uniform Wall Thickness",
              "unit": "in",
              "unitRule": "declared",
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),IF(2<>0,({outsideDiameterIn}-{insideDiameterIn})/2,0),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "insideDiameterIn",
               "outsideDiameterIn",
               "solidDensityLbPerIn3"
              ],
              "constants": {},
              "templateIndex": null
             },
             {
              "index": 3,
              "label": "Mass per Inch",
              "unit": "lb/in",
              "unitRule": "declared",
              "expression": "IF(ISNUMBER({solidDensityLbPerIn3}),IF(({solidDensityLbPerIn3}>=0.000001),IF(({solidDensityLbPerIn3}<=1),IF(ISNUMBER({insideDiameterIn}),IF(({insideDiameterIn}>=0),IF(({insideDiameterIn}<=1000),IF(ISNUMBER({outsideDiameterIn}),IF(({outsideDiameterIn}>=0.0001),IF(({outsideDiameterIn}<=1000),IF(({insideDiameterIn}<{outsideDiameterIn}),((IF(4<>0,3.14159265358979/4,0)*(({outsideDiameterIn}*{outsideDiameterIn})-({insideDiameterIn}*{insideDiameterIn})))*{solidDensityLbPerIn3}),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\"),\"\")",
              "inputKeys": [
               "insideDiameterIn",
               "outsideDiameterIn",
               "solidDensityLbPerIn3"
              ],
              "constants": {},
              "templateIndex": null
             }
            ]
           },
           "derivation": {
            "formula": [
             "Wall area = π × (outside diameter² − inside diameter²) ÷ 4",
             "Pipe weight per foot = wall area × solid density × 12",
             "Uniform wall thickness = (outside diameter − inside diameter) ÷ 2",
             "Mass per inch = wall area × solid density"
            ],
            "providedInputs": [
             {
              "key": "outsideDiameterIn",
              "label": "Finished Outside Diameter",
              "value": 2,
              "unit": "in"
             },
             {
              "key": "insideDiameterIn",
              "label": "Finished Inside Diameter",
              "value": 1.75,
              "unit": "in"
             },
             {
              "key": "solidDensityLbPerIn3",
              "label": "Solid Resin Density",
              "value": 0.034,
              "unit": "lb/in³"
             }
            ],
            "assumedDefaults": [],
            "inputCount": 3,
            "assumedCount": 0,
            "reproduceUrl": "https://www.mfgcalcs.com/api/v1/calc/plastics-extrusion-pipe-film-profile-pipe-weight-per-foot?finished-outside-diameter=2&finished-inside-diameter=1.75&solid-resin-density=0.034",
            "note": "Every input was supplied by the caller; no defaults were assumed.",
            "confidence": "high",
            "confidenceBasis": "Every input was supplied and every result row computed.",
            "checks": {
             "relationshipRules": [
              {
               "code": "plastics-extrusion-pipe-film-profile-pipe-weight-per-foot-relation-1",
               "passed": true
              }
             ]
            }
           },
           "attribution": "Calculation by MFG Calcs: https://www.mfgcalcs.com/calculators/plastics-extrusion-pipe-film-profile/pipe-weight-per-foot",
           "license": "Free to use with attribution. Results are engineering estimates; verify against your own process data."
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "An input outside its documented min/max (code INPUT_OUT_OF_RANGE); `outOfRange` names each field, the bound and the value received."
     },
     "404": {
      "description": "Unknown calculator slug."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/workbook/{slug}.xlsx": {
   "get": {
    "operationId": "workbook",
    "summary": "Download a calculator as an Excel workbook",
    "description": "Branded .xlsx with editable inputs; most calculators carry live, build-verified Excel formulas that recalculate as inputs change.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Excel workbook",
      "content": {
       "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "404": {
      "description": "Unknown calculator slug."
     }
    }
   }
  },
  "/api/calc/{slug}": {
   "get": {
    "operationId": "calcBySlug",
    "summary": "Run a calculator by slug (path form)",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "explain",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "checks",
        "trace"
       ]
      },
      "description": "Run responses only: explain=checks adds derivation.checks, the structured record of every reviewed cross-field rule and whether it held. explain=trace includes those checks plus executionTrace: accepted inputs and units, actual engine arguments, executed expressions where available, raw output outcomes and API rounding. Internal arithmetic steps are not captured. The default response is unchanged."
     }
    ],
    "responses": {
     "200": {
      "description": "Calculation results, the same run shape as /api/calc?tool=: inputs with their sources, labeled result rows with units, formula, derivation and citation URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "One of three shapes, discriminated by the request: search results (search=), a calculator description (describe=), or a run (tool=) with labeled results. Validation failures are 400s with INVALID_CALCULATOR_INPUTS, INPUT_OUT_OF_RANGE, CONFLICTING_INPUT_ALIASES or INCONSISTENT_INPUTS, never a computed result.",
         "properties": {
          "query": {
           "type": "string",
           "description": "Search responses: the bounded query that ran."
          },
          "count": {
           "type": "integer",
           "description": "Search responses: number of matches returned."
          },
          "results": {
           "type": "array",
           "description": "Search matches (with search) or labeled result rows with units (with tool).",
           "items": {
            "anyOf": [
             {
              "type": "object",
              "required": [
               "tool",
               "name",
               "category",
               "description",
               "url",
               "run"
              ],
              "properties": {
               "tool": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "category": {
                "type": "string"
               },
               "description": {
                "type": "string"
               },
               "url": {
                "type": "string",
                "description": "Canonical calculator page to cite (CC BY 4.0 attribution)."
               },
               "run": {
                "type": "string",
                "description": "URL that runs this calculator with its documented defaults."
               }
              }
             },
             {
              "type": "object",
              "required": [
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "label": {
                "type": "string"
               },
               "value": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Null only when the row cannot be computed from the given inputs; confidence is then 'none' and derivation.uncomputableResults names the zero responsible."
               },
               "unit": {
                "type": "string"
               },
               "headline": {
                "type": "boolean",
                "description": "True for the row the calculator presents as its answer."
               }
              }
             }
            ]
           }
          },
          "tool": {
           "type": "string",
           "description": "Run/describe responses: the registry slug."
          },
          "name": {
           "type": "string"
          },
          "category": {
           "type": "string"
          },
          "description": {
           "type": "string",
           "description": "Describe responses only."
          },
          "useCase": {
           "type": "string",
           "description": "Describe responses only."
          },
          "notes": {
           "type": "object",
           "description": "Describe responses only: optional what/when/limits notes."
          },
          "url": {
           "type": "string",
           "description": "Canonical calculator page, for citation."
          },
          "inputs": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "key",
             "param",
             "label",
             "unit"
            ],
            "properties": {
             "key": {
              "type": "string",
              "description": "Canonical input key."
             },
             "param": {
              "type": "string",
              "description": "Preferred query-parameter name."
             },
             "label": {
              "type": "string"
             },
             "unit": {
              "type": "string"
             },
             "value": {
              "type": "number",
              "description": "Run responses only: the numeric value used, whether caller-supplied or the documented default."
             },
             "source": {
              "type": "string",
              "enum": [
               "input",
               "default"
              ],
              "description": "Run responses only: whether the caller supplied this value or the calculator's documented default was used."
             },
             "default": {
              "type": "string",
              "description": "Describe responses only: the documented default, as a string."
             },
             "min": {
              "type": "number"
             },
             "max": {
              "type": "number"
             },
             "requiresPositive": {
              "type": "boolean",
              "description": "Describe responses only: documented minimum is 0, but a value of 0 leaves a result row uncomputable."
             },
             "requiresPositiveNote": {
              "type": "string"
             },
             "wholeNumber": {
              "type": "boolean",
              "description": "Describe responses only: value must be an integer (a count)."
             },
             "legacyAliases": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "description": "Old parameter names that still bind to this input."
             },
             "hint": {
              "type": "string"
             }
            }
           },
           "description": "Run responses: the values used, each marked input or default. Describe responses: the declared fields with defaults and bounds."
          },
          "formula": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "release": {
           "type": "string",
           "description": "Present for next-generation (V2) calculators."
          },
          "issues": {
           "type": "array",
           "items": {
            "type": "object"
           },
           "description": "V2 calculators only: calculation issues with code, severity and message."
          },
          "assessment": {
           "type": "object",
           "description": "V2 calculators only: blocked/warning/clear plus a note."
          },
          "derivation": {
           "type": "object",
           "required": [
            "formula",
            "providedInputs",
            "assumedDefaults",
            "inputCount",
            "assumedCount",
            "reproduceUrl",
            "note",
            "confidence",
            "confidenceBasis"
           ],
           "properties": {
            "formula": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "providedInputs": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": "string"
               }
              }
             }
            },
            "assumedDefaults": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "value",
               "unit"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": "string"
               }
              }
             }
            },
            "inputCount": {
             "type": "integer"
            },
            "assumedCount": {
             "type": "integer"
            },
            "reproduceUrl": {
             "type": "string",
             "description": "Re-running this URL reproduces the result exactly, defaults included."
            },
            "note": {
             "type": "string"
            },
            "confidence": {
             "type": "string",
             "enum": [
              "none",
              "high",
              "medium",
              "low"
             ],
             "description": "Grades the OUTPUT, not the input: 'none' whenever a result row is uncomputable or a blocking issue exists; otherwise by how many inputs were assumed."
            },
            "confidenceBasis": {
             "type": "string"
            },
            "checks": {
             "type": "object",
             "description": "Structured completeness record, present when the run requested explain=checks or explain=trace. relationshipRules lists every reviewed cross-field rule for the slug with whether it held; a successful response contains only passed entries, and an explicit empty list means the slug has no reviewed relationship rule.",
             "properties": {
              "relationshipRules": {
               "type": "array",
               "items": {
                "type": "object",
                "required": [
                 "code",
                 "passed"
                ],
                "properties": {
                 "code": {
                  "type": "string"
                 },
                 "passed": {
                  "type": "boolean"
                 }
                }
               }
              }
             }
            },
            "uncomputableResults": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "label",
               "unit",
               "reason"
              ],
              "properties": {
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "reason": {
                "type": "string"
               },
               "raiseAboveZero": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          },
          "executionTrace": {
           "type": "object",
           "description": "Optional run disclosure requested with explain=trace. Records accepted inputs, actual engine arguments and returned rows before API serialization. Formula/template expressions are actual evaluator arguments; code engines have null expressions. Internal arithmetic steps, branch decisions and engine-specific rounding are not captured. Source references and documented formulas do not independently verify the model or authenticate a historical runtime.",
           "required": [
            "schemaVersion",
            "tool",
            "name",
            "engine",
            "method",
            "inputs",
            "operands",
            "outputs",
            "internalSteps",
            "limits"
           ],
           "properties": {
            "schemaVersion": {
             "type": "string",
             "const": "mfgcalcs.calculator-execution-trace.v1"
            },
            "tool": {
             "type": "string",
             "description": "Executed registry slug."
            },
            "name": {
             "type": "string"
            },
            "engine": {
             "type": "string",
             "enum": [
              "registry-template",
              "registry-formula",
              "calculator-code"
             ]
            },
            "method": {
             "type": "object",
             "required": [
              "registryRef",
              "evaluatorRef",
              "inputPolicyRef",
              "resultNormalizationRef",
              "formulaVersion",
              "contentVersion",
              "workbookVersion",
              "documentedFormulas"
             ],
             "properties": {
              "registryRef": {
               "type": "string",
               "description": "Registry source reference, not a content hash."
              },
              "evaluatorRef": {
               "type": "string",
               "description": "Actual evaluator or code dispatch reference."
              },
              "inputPolicyRef": {
               "type": "string",
               "const": "api/calc.ts#runCalculator"
              },
              "resultNormalizationRef": {
               "type": "string",
               "const": "api/calc.ts#sanitize"
              },
              "formulaVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "contentVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "workbookVersion": {
               "type": [
                "string",
                "null"
               ]
              },
              "documentedFormulas": {
               "type": "array",
               "items": {
                "type": "string"
               },
               "description": "Explanatory registry text, distinct from observed executable expressions."
              }
             }
            },
            "inputs": {
             "type": "array",
             "description": "Accepted values in their declared units, before engine-specific normalization.",
             "items": {
              "type": "object",
              "required": [
               "key",
               "label",
               "unit",
               "value",
               "source"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "source": {
                "type": "string",
                "enum": [
                 "input",
                 "default"
                ]
               }
              }
             }
            },
            "operands": {
             "type": "array",
             "description": "Arguments at dispatch: after existing template normalization, or the arguments passed to the formula/code engine. Does not disclose transformations inside a code engine.",
             "items": {
              "type": "object",
              "required": [
               "key",
               "value",
               "unit",
               "declaredInput"
              ],
              "properties": {
               "key": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "unit": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "declaredInput": {
                "type": "boolean",
                "description": "False for template slots supplied as zero constants rather than declared inputs."
               }
              }
             }
            },
            "outputs": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "index",
               "label",
               "unit",
               "headline",
               "expression",
               "rawValue",
               "rawOutcome",
               "value",
               "serialization"
              ],
              "properties": {
               "index": {
                "type": "integer",
                "minimum": 0
               },
               "label": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "headline": {
                "type": "boolean"
               },
               "expression": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "Exact formula/template evaluator expression; null when code was executed, even if a workbook expression exists."
               },
               "rawValue": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Finite engine output before API serialization; null for nonfinite output. Not an arbitrary-precision value or a record of internal rounding."
               },
               "rawOutcome": {
                "type": "string",
                "enum": [
                 "finite",
                 "not-a-number",
                 "positive-infinity",
                 "negative-infinity"
                ]
               },
               "value": {
                "type": [
                 "number",
                 "null"
                ],
                "description": "Published result after API serialization."
               },
               "serialization": {
                "type": "string",
                "enum": [
                 "nonfinite-to-null",
                 "Math.round(value * 1e6) / 1e6",
                 "finite-value-preserved-to-avoid-rounding-overflow"
                ]
               }
              }
             }
            },
            "internalSteps": {
             "type": "string",
             "const": "not-captured"
            },
            "limits": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           }
          },
          "attribution": {
           "type": "string",
           "description": "Run responses: the attribution line to cite."
          },
          "license": {
           "type": "string"
          },
          "sponsor": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "url": {
             "type": "string"
            }
           }
          },
          "workbook": {
           "type": "string",
           "description": "Describe responses: the canonical /api/workbook/<slug>.xlsx download for this calculator."
          },
          "versions": {
           "type": "object",
           "description": "Describe responses for V2 calculators: formula, content and workbook versions."
          },
          "methodology": {
           "type": "object",
           "description": "Describe responses for V2 calculators: method notes, assumptions, limitations and sources."
          }
         },
         "oneOf": [
          {
           "required": [
            "query",
            "count",
            "results"
           ]
          },
          {
           "required": [
            "tool",
            "name",
            "description",
            "useCase",
            "url",
            "inputs",
            "workbook"
           ]
          },
          {
           "required": [
            "tool",
            "name",
            "url",
            "inputs",
            "results",
            "derivation"
           ]
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "An input outside its documented min/max (code INPUT_OUT_OF_RANGE); `outOfRange` names each field, the bound and the value received."
     },
     "404": {
      "description": "Unknown calculator slug."
     }
    }
   }
  },
  "/api/tariff": {
   "get": {
    "operationId": "lookupTariff",
    "summary": "Look up U.S. tariff rates by keyword, family, or HTS code",
    "description": "Statutory HTS General and Special rates, informational Chapter 99 references, and effective calculated-duty rates (USITC Calculated Duties / covered customs value), with top source countries, for 57 manufacturing families. From the USITC snapshot behind /tariffs. Reference data, not a customs ruling.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Keyword ('fasteners'), family key ('steel-fasteners'), or HTS code/prefix ('7318.15.20')"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 10
      },
      "description": "Max family matches, default 5"
     }
    ],
    "responses": {
     "200": {
      "description": "Family matches with statutory + effective rates; rate lines for HTS queries."
     },
     "400": {
      "description": "Missing or empty query."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   },
   "post": {
    "operationId": "optimizeSupplierOrders",
    "summary": "Optimize integer supplier orders with packs, MOQ and fixed fees",
    "description": "POST is supported only with optimize=orders. Demand plus allowed overbuy must not exceed 10 million units; use one currency. Supplier share caps use requested demand. One activation fee applies per used supplier. HiGHS uses a 5-second/5,000-node native limit; feasible incumbents are independently checked. The adapter does not expose an achieved gap, so optimalityGap is null. Private/no-store; 64 KiB body cap. Existing GET LP requests are unchanged.",
    "parameters": [
     {
      "name": "optimize",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "const": "orders"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "demand": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000000
         },
         "maxOverbuy": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
         },
         "maxSharePct": {
          "type": "number",
          "minimum": 0.000001,
          "maximum": 100
         },
         "suppliers": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
           "type": "object",
           "additionalProperties": false,
           "properties": {
            "name": {
             "type": "string",
             "minLength": 1,
             "maxLength": 100
            },
            "unitCost": {
             "type": "number",
             "minimum": 0,
             "maximum": 10000000
            },
            "tariffPct": {
             "type": "number",
             "minimum": 0,
             "maximum": 10000
            },
            "freightPerUnit": {
             "type": "number",
             "minimum": 0,
             "maximum": 10000000
            },
            "capacity": {
             "type": "integer",
             "minimum": 0,
             "maximum": 10000000
            },
            "minimumOrderQty": {
             "type": "integer",
             "minimum": 0,
             "maximum": 10000000
            },
            "packSize": {
             "type": "integer",
             "minimum": 1,
             "maximum": 10000000
            },
            "fixedOrderCost": {
             "type": "number",
             "minimum": 0,
             "maximum": 10000000
            }
           },
           "required": [
            "name",
            "unitCost"
           ]
          }
         }
        },
        "required": [
         "demand",
         "suppliers"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Solver result; inspect status before using allocation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "schemaVersion",
          "status",
          "allocation",
          "totalQuantity",
          "totalCost",
          "optimalityGap"
         ],
         "properties": {
          "schemaVersion": {
           "const": "mfgcalcs.sourcing-orders.v1"
          },
          "status": {
           "enum": [
            "optimal",
            "feasible",
            "no_incumbent",
            "infeasible",
            "invalid",
            "failed"
           ]
          },
          "allocation": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "name": {
              "type": "string"
             },
             "quantity": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000000
             },
             "packs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000000
             },
             "active": {
              "type": "boolean"
             },
             "landedUnitCost": {
              "type": "number"
             },
             "variableCost": {
              "type": "number"
             },
             "fixedCost": {
              "type": "number"
             },
             "totalCost": {
              "type": "number"
             }
            }
           }
          },
          "totalQuantity": {
           "type": [
            "integer",
            "null"
           ]
          },
          "overbuy": {
           "type": [
            "integer",
            "null"
           ]
          },
          "totalCost": {
           "type": [
            "number",
            "null"
           ]
          },
          "optimalityGap": {
           "type": "null"
          },
          "solverStatus": {
           "type": [
            "string",
            "null"
           ]
          },
          "solverLimits": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid JSON, fields or numeric bounds."
     },
     "413": {
      "description": "Request body too large."
     },
     "422": {
      "description": "No feasible order allocation."
     },
     "429": {
      "description": "Rate or admission limit."
     },
     "500": {
      "description": "Solver failure or invalid incumbent."
     },
     "503": {
      "description": "Calculation journey or execution admission unavailable."
     }
    }
   }
  },
  "/api/tariff-index": {
   "get": {
    "operationId": "tariffIndex",
    "summary": "The U.S. Manufacturing Effective-Tariff Index as a citable series",
    "description": "USITC Calculated Duties divided by covered customs value across a constant manufacturing panel, monthly since 2014-01 and rebased to an index (base = 100). This is a statistical effective-rate measure, not a cash-collections ledger or a legal attribution. Returns the latest reading and the trailing 24 monthly observations by default; points=all returns full history. Full page at /data/us-manufacturing-effective-tariff-index.",
    "parameters": [
     {
      "name": "points",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "How much of the series to return: omit for the trailing 24 months (default), 'all' for full history, 'latest' for the latest month only, or a positive integer for the last N months, e.g. '12'."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Alternate history-depth parameter with the same values as points; points takes precedence when both are supplied. Omit both for the trailing 24 months."
     }
    ],
    "responses": {
     "200": {
      "description": "The index: name, base, panel size, coverage, latest reading, monthly points (effectiveRatePct, index, momPp, yoyPp), download URLs, source, and license."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/landed-cost": {
   "get": {
    "operationId": "rankLandedCost",
    "summary": "Compare source-country landed costs where country prices exist",
    "description": "For a manufacturing family, compares per-country effective calculated-duty and international-freight burdens using uplift = 1 + duty + freight. A country receives a landed-unit-cost rank only when its own reported unit value, duty, and freight are all available; missing prices remain unknown. Also returns source concentration and an FX direction. A sourcing indicator, not a customs quote. Full pages at /landed-cost.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Family key, e.g. 'steel-flat-rolled', 'bearings', 'aluminum-semis'. Omit to list all families, including explicit price-availability status."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "For the unfiltered family directory, return 'all' (default) or at most this positive number of families."
     }
    ],
    "responses": {
     "200": {
      "description": "Country lanes with duty, freight, additive burden, optional modeled landed customs unit value, a rank only when at least two lanes are complete, import share, FX, concentration, and downloads."
     },
     "400": {
      "description": "Unknown family key."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/reshoring": {
   "get": {
    "operationId": "reshoringScore",
    "summary": "The Reshoring Readiness Index: 0-100 case to reshore, per family",
    "description": "Should the U.S. reshore a manufacturing input? A transparent 0-100 monthly score per import family (higher = stronger case): 0.45 x tariff pressure + 0.30 x import dependence + 0.25 x sourcing concentration, methodology versioned and published. Pass family for full detail with the monthly series back to 2014; omit it for the ranked leaderboard. Built on USITC public data; a screening indicator, not sourcing advice. Pages at /reshoring.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Family key, e.g. 'bearings', 'steel-flat-rolled'. Omit for the ranked leaderboard."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "For the unfiltered leaderboard, omit for the top 15 families (default), use 'all' for every family, or provide a positive row count."
     }
    ],
    "responses": {
     "200": {
      "description": "One family's score, rank, term breakdown, and monthly series; or the ranked directory of all families. Includes methodology, downloads, and license."
     },
     "400": {
      "description": "Unknown family key."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/answer": {
   "get": {
    "operationId": "answerQuestion",
    "summary": "Answer manufacturing questions, collect calculator inputs, or clarify a subject",
    "description": "The deterministic answer engine shared by MCP ask, MFGSearch, and MFGChat. No LLM. Statistical answers identify their period, frequency, scope, and measure. An unresolved subject or tied product family returns resolution=needs-clarification, stat=null, and no citation. A selected calculator collects required inputs, validates supplied values, and executes when complete; missing or invalid inputs request clarification without claiming a calculated result. Calculator guidance may include field counts, accepted values, and a link to the published method. Pass the latest opaque context unchanged to retain the confirmed subject, country, period, and calculator inputs across replies and corrections. Documented defaults are used by guided calculations only for an explicitly requested illustrative example. The detail projection controls depth: answer is compact; evidence adds scoped evidence, calculator guidance, and relevant adjacent facts; full is the compatibility default and preserves the forensic payload. Try 'effective tariff on bearings', 'what is OEE', or 'Calculate OEE'. Direct structured calculations are also available at /api/calc; broader entity search is at /api/search.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 500
      },
      "description": "A full question in plain English"
     },
     {
      "name": "context",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 1024
      },
      "description": "The opaque context returned by the preceding answer. Pass the latest token unchanged on the next turn to retain the confirmed entity, country, period, intent, and calculator inputs or resolve a subject choice. Calculator drafts are revalidated against the current field schema. Context expires after 30 minutes; malformed or expired context is ignored. It is caller-held continuation state, not authentication or evidence that supplied measurements are correct."
     },
     {
      "name": "detail",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "answer",
        "evidence",
        "full"
       ],
       "default": "full"
      },
      "description": "Response depth. answer returns the sentence, headline statistic, citation, trust blocks, and context while omitting points, adjacent facts, and the tool payload. evidence adds a bounded relevant series window, scoped evidence, calculator guidance when applicable, and up to five adjacent facts. full returns the compatibility-default forensic payload."
     }
    ],
    "responses": {
     "200": {
      "description": "A composed answer, calculator guidance, or structured clarification. Branch on `outcome` (additive) and `fulfilled` before treating a reply as complete; only answered fulfills a calculation, and a related-resource reply fulfills a request for that link. `resolution` stays as the frozen legacy signal and cannot express unsupported or related-resource results, which carry fallback=true as a compatibility bridge. Unresolved subjects have stat=null and no citation. A selected calculator requesting inputs also has stat=null (outcome=needs-input), but may name supplied values and link its published method; that link is not a completed result. Input collection can have fallback=false, so neither HTTP success nor fallback alone establishes completion. In evidence/full detail, inspect payload.calculatorGuidance for accepted inputs, missing fields, errors, and guidance kind. Unsupported requested dimensions may be identified by `unsupportedAttribute`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "query",
          "intent",
          "resolution",
          "detail",
          "answer",
          "confidence",
          "stat",
          "url",
          "source",
          "receipt",
          "freshness",
          "context"
         ],
         "properties": {
          "query": {
           "type": "string"
          },
          "intent": {
           "type": "string"
          },
          "resolution": {
           "type": "string",
           "enum": [
            "resolved",
            "needs-clarification"
           ],
           "description": "Frozen legacy compatibility signal: whether the response answers the question or requests a subject, product-family choice, missing calculator inputs, or corrected values. It cannot express unsupported or related-resource results; branch on `outcome` instead. New enum values will never be added here."
          },
          "outcome": {
           "type": "string",
           "enum": [
            "answered",
            "needs-input",
            "needs-clarification",
            "invalid-input",
            "unsupported",
            "related-resource"
           ],
           "description": "Authoritative fulfillment outcome (additive). answered: The requested operation and scope were satisfied; a scoped statistic or calculator result is present, and fulfilled is true. needs-input: A calculator was selected but declared inputs are missing; values already supplied are retained and stat is null. needs-clarification: The subject or product family is ambiguous, or a rejected value needs a replacement; no number is guessed and no citation is returned. invalid-input: Supplied values were rejected, for example outside a documented bound or in conflict with another field. unsupported: The question named a dimension this platform has no data for; unsupportedAttribute names it, and related published facts may still be included. related-resource: A relevant link stands in for the request, such as a definition, guide, or dataset. Legacy cases the resolution enum cannot express carry fallback=true as a compatibility bridge; unmodified resolution-only clients cannot distinguish unsupported from related-resource."
          },
          "fulfilled": {
           "type": "boolean",
           "description": "Additive completion flag. True only for answered, and for a related-resource reply that fulfilled a request for that link. Never true for needs-input, needs-clarification, invalid-input or unsupported. Legacy consumers that only read `resolution`/`fallback` must continue to treat fallback=true as not fulfilled."
          },
          "detail": {
           "type": "string",
           "enum": [
            "answer",
            "evidence",
            "full"
           ],
           "default": "full",
           "description": "The response-depth projection applied to this result."
          },
          "answer": {
           "type": "string",
           "description": "The composed answer or clarification. Calculator guidance may list accepted inputs and missing fields without claiming a calculated result."
          },
          "confidence": {
           "type": "string",
           "enum": [
            "high",
            "low"
           ],
           "description": "Confidence in the selected subject or answer. A known calculator can have high confidence while still requesting required inputs; this is not a completion or universal accuracy score."
          },
          "stat": {
           "oneOf": [
            {
             "type": "object",
             "required": [
              "value",
              "unit",
              "period",
              "frequency",
              "scope",
              "measure",
              "change"
             ],
             "properties": {
              "value": {
               "type": "string"
              },
              "unit": {
               "type": [
                "string",
                "null"
               ]
              },
              "period": {
               "type": "string"
              },
              "frequency": {
               "type": "string"
              },
              "scope": {
               "type": "string"
              },
              "measure": {
               "type": "string"
              },
              "change": {
               "type": [
                "string",
                "null"
               ]
              },
              "changeReadout": {
               "type": "object",
               "description": "Optional server-composed display and numeric change metadata for the shared answer cards."
              },
              "now": {
               "type": "object",
               "required": [
                "display",
                "periodLabel",
                "bridge"
               ],
               "properties": {
                "display": {
                 "type": "string"
                },
                "periodLabel": {
                 "type": "string"
                },
                "bridge": {
                 "type": [
                  "object",
                  "null"
                 ]
                }
               },
               "description": "Optional current observation and then-to-now change for a historical answer."
              },
              "invert": {
               "type": "boolean"
              }
             }
            },
            {
             "type": "null"
            }
           ],
           "description": "Headline statistic with its observation period, data frequency, subject/geographic scope, and measure definition. Null for clarification responses and answers without a statistic."
          },
          "url": {
           "type": [
            "string",
            "null"
           ],
           "description": "Canonical source URL. A calculator collecting inputs may link its documented method; that link is not a completed calculation. Unresolved subjects have no citation."
          },
          "source": {
           "type": [
            "string",
            "null"
           ],
           "description": "Source label for the answer or published calculator method; unresolved subjects have no source label."
          },
          "points": {
           "type": [
            "array",
            "null"
           ],
           "items": {
            "type": "object",
            "required": [
             "period",
             "value"
            ],
            "properties": {
             "period": {
              "type": "string"
             },
             "value": {
              "type": "number"
             }
            }
           },
           "description": "Underlying series when selected by detail. Omitted as null in answer mode; bounded to a relevant window in evidence mode; lossless in full mode."
          },
          "receipt": {
           "type": "object",
           "description": "Receipt status and signed claim when available."
          },
          "freshness": {
           "type": "object",
           "description": "Measured-cadence freshness state for the evidence actually used, or the reason it cannot be assessed."
          },
          "context": {
           "type": [
            "string",
            "null"
           ],
           "description": "Opaque continuation token to pass unchanged with the next question. Product clarification retains country, period, intent, and candidate choices without a guessed product. Calculator turns retain the selected tool and validated draft inputs, including corrections, within the existing context limits."
          },
          "alsoMatters": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "period",
             "frequency",
             "scope",
             "measure"
            ],
            "properties": {
             "period": {
              "type": "string"
             },
             "frequency": {
              "type": "string"
             },
             "scope": {
              "type": "string"
             },
             "measure": {
              "type": "string"
             }
            }
           },
           "description": "Relevant adjacent facts selected by evidence/full detail; each numeric fact carries its own period, frequency, scope, and measure."
          },
          "payload": {
           "description": "Source-tool payload. Null in answer mode, scoped in evidence mode, and lossless in full mode. Calculator responses include calculatorGuidance; completed calculations also retain the actual calculator results and derivation. Guidance or an illustrative example must not be treated as execution of the caller's complete measurements.",
           "properties": {
            "calculatorGuidance": {
             "type": "object",
             "properties": {
              "kind": {
               "type": "string",
               "enum": [
                "guidance",
                "inputs",
                "calculation",
                "example",
                "unresolved"
               ]
              },
              "acceptedInputs": {
               "type": "object",
               "additionalProperties": {
                "type": "number"
               }
              },
              "missingInputs": {
               "type": "array",
               "items": {
                "type": "object",
                "required": [
                 "key",
                 "label",
                 "unit"
                ],
                "properties": {
                 "key": {
                  "type": "string"
                 },
                 "label": {
                  "type": "string"
                 },
                 "unit": {
                  "type": "string"
                 }
                }
               }
              },
              "errors": {
               "type": "array",
               "items": {
                "type": "string"
               }
              },
              "metadata": {
               "type": "object"
              }
             }
            }
           }
          },
          "followups": {
           "type": "array",
           "items": {
            "type": "string"
           },
           "description": "Supported next questions. Use these when an input clarification has no subject choices, passing the latest context with the selected question."
          },
          "sourceTool": {
           "type": [
            "object",
            "null"
           ],
           "properties": {
            "tool": {
             "type": "string"
            },
            "arguments": {
             "type": "object"
            }
           },
           "description": "Source operation and arguments when available. Calculator guidance identifies get_calculator; an executed calculation or illustrative example identifies run_calculator."
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Missing or empty question, an overlong query, or an invalid detail value (code INVALID_DETAIL)."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/search": {
   "get": {
    "operationId": "searchSite",
    "summary": "Search the whole platform: calculators, live data, tariffs, definitions",
    "description": "One search over everything MFG Calcs answers about: 5,000+ calculators, live economic series, tariff families, state costs, glossary definitions, datasets, and hub pages. Returns ranked entity matches with titles, URLs, and hints — the same resolver behind MFGSearch and the search_site MCP tool.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 500
      },
      "description": "Free-text query, e.g. 'bearings tariff' or 'steel imports'"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20
      },
      "description": "Max results, default 8"
     }
    ],
    "responses": {
     "200": {
      "description": "Ranked matches with type, title, url, and hint."
     },
     "400": {
      "description": "Missing or empty query."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/forecast": {
   "get": {
    "operationId": "forecast",
    "summary": "Six-month forecasts for every published series",
    "description": "A six-month statistical forecast (damped Holt-Winters) for every series that clears the gate (at least 12 monthly observations and a backtest MAPE under 35%), from the same committed artifacts the pages render. Omit series for the board, or pass a series slug for one forecast with its full history, empirical 80% band and backtest error. Each detail response states the anchor period, the horizons that actually exist (supportedHorizons) and the data page behind it; held-back series state why rather than disappearing. Statistical extrapolation, not a market or policy forecast.",
    "parameters": [
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Series slug (e.g. wti-crude-oil-spot) for one forecast with full history; omit for the board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Board depth: \"all\" or a positive integer; omit for the default bounded board. Ignored for a single series."
     }
    ],
    "responses": {
     "200": {
      "description": "The board (rows with published/held-back state and stated reasons) or one series with history, forecast points plus band, backtest pairs and uncertainty. The schema discriminates the two shapes; examples are real engine output.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "name",
          "version",
          "horizon",
          "measure",
          "gate",
          "caveat",
          "source",
          "license",
          "asOf",
          "url"
         ],
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "string"
          },
          "horizon": {
           "type": "integer",
           "description": "Published horizon in months after each series' latest observation."
          },
          "measure": {
           "type": "string"
          },
          "gate": {
           "type": "string"
          },
          "caveat": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "license": {
           "type": "string"
          },
          "asOf": {
           "type": "string",
           "description": "Artifact generation stamp."
          },
          "url": {
           "type": "string"
          },
          "publishedCount": {
           "type": "integer",
           "description": "Board responses only."
          },
          "heldBackCount": {
           "type": "integer",
           "description": "Board responses only."
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "slug",
             "title",
             "category",
             "published",
             "url"
            ],
            "properties": {
             "slug": {
              "type": "string"
             },
             "title": {
              "type": "string"
             },
             "category": {
              "type": "string"
             },
             "published": {
              "type": "boolean",
              "description": "False when the series is held back; reason states why."
             },
             "latestValue": {
              "type": [
               "number",
               "null"
              ]
             },
             "endValue": {
              "type": [
               "number",
               "null"
              ]
             },
             "changePct": {
              "type": [
               "number",
               "null"
              ]
             },
             "direction": {
              "type": "string",
              "description": "rising, falling, flat, or empty when the move has no direction."
             },
             "mapePct": {
              "type": [
               "number",
               "null"
              ],
              "description": "Out-of-sample backtest error; weight the forecast by it."
             },
             "reason": {
              "type": [
               "string",
               "null"
              ],
              "description": "Why a held-back series is not forecast."
             },
             "url": {
              "type": "string"
             }
            }
           },
           "description": "Board responses (no series parameter)."
          },
          "resultSets": {
           "type": "array",
           "items": {
            "type": "object"
           },
           "description": "Board responses: how the returned rows were bounded and the call that returns more."
          },
          "requested": {
           "type": "string",
           "description": "Detail responses: the series input as received."
          },
          "resolvedIdentifier": {
           "type": "object",
           "required": [
            "key",
            "slug",
            "title",
            "titleTokens",
            "aliases"
           ],
           "properties": {
            "key": {
             "type": "string"
            },
            "slug": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "titleTokens": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "aliases": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           },
           "description": "Detail responses: the canonical series the input resolved to."
          },
          "referencePeriod": {
           "type": [
            "string",
            "null"
           ],
           "description": "Detail responses: the newest observation the model is anchored on."
          },
          "supportedHorizons": {
           "type": "object",
           "required": [
            "min",
            "max",
            "unit"
           ],
           "properties": {
            "min": {
             "type": "integer"
            },
            "max": {
             "type": "integer"
            },
            "unit": {
             "type": "string"
            }
           },
           "description": "Detail responses: the forecast months that actually exist, so a requested horizon can be matched exactly instead of inferred."
          },
          "series": {
           "type": "object",
           "required": [
            "key",
            "slug",
            "title"
           ],
           "properties": {
            "key": {
             "type": "string"
            },
            "slug": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "unit": {
             "type": [
              "string",
              "null"
             ]
            },
            "category": {
             "type": "string"
            },
            "source": {
             "type": [
              "string",
              "null"
             ]
            },
            "sourceUrl": {
             "type": [
              "string",
              "null"
             ]
            },
            "latestPeriod": {
             "type": [
              "string",
              "null"
             ]
            },
            "latestValue": {
             "type": [
              "number",
              "null"
             ]
            },
            "latestValueLabel": {
             "type": [
              "string",
              "null"
             ]
            },
            "cadence": {
             "type": "string",
             "description": "monthly, weekly or daily."
            },
            "anchorNote": {
             "type": [
              "string",
              "null"
             ],
             "description": "What the model is anchored on, and why."
            },
            "excludedPeriod": {
             "type": [
              "string",
              "null"
             ]
            },
            "excludedValueLabel": {
             "type": [
              "string",
              "null"
             ]
            },
            "published": {
             "type": "boolean",
             "description": "Present and false when the series is held back; published series omit it."
            },
            "reason": {
             "type": [
              "string",
              "null"
             ]
            },
            "endValue": {
             "type": [
              "number",
              "null"
             ]
            },
            "endValueLabel": {
             "type": [
              "string",
              "null"
             ]
            },
            "changePct": {
             "type": [
              "number",
              "null"
             ]
            },
            "direction": {
             "type": "string"
            },
            "horizonPeriod": {
             "type": [
              "string",
              "null"
             ]
            },
            "mapePct": {
             "type": [
              "number",
              "null"
             ]
            },
            "uncertainty": {
             "type": "object",
             "required": [
              "status",
              "grade",
              "reason",
              "lagMonths",
              "stalled",
              "errorPct",
              "provenanceVerified",
              "pinnable",
              "scale"
             ],
             "properties": {
              "status": {
               "type": "string",
               "enum": [
                "final",
                "provisional",
                "forecast"
               ]
              },
              "grade": {
               "type": "string",
               "enum": [
                "high",
                "medium",
                "low"
               ],
               "description": "A grade, not a probability; scale states how to read it."
              },
              "reason": {
               "type": "string"
              },
              "lagMonths": {
               "type": [
                "integer",
                "null"
               ]
              },
              "stalled": {
               "type": "boolean"
              },
              "errorPct": {
               "type": [
                "number",
                "null"
               ]
              },
              "provenanceVerified": {
               "type": "boolean"
              },
              "pinnable": {
               "type": "boolean"
              },
              "scale": {
               "type": "string"
              }
             }
            },
            "method": {
             "type": "string"
            },
            "seasonal": {
             "type": "boolean"
            },
            "damped": {
             "type": "boolean"
            },
            "history": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "period",
               "value"
              ],
              "properties": {
               "period": {
                "type": "string"
               },
               "value": {
                "type": "number"
               }
              }
             },
             "description": "Trailing monthly observations the model saw."
            },
            "forecast": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "period",
               "value",
               "lo",
               "hi"
              ],
              "properties": {
               "period": {
                "type": "string"
               },
               "value": {
                "type": "number"
               },
               "lo": {
                "type": "number"
               },
               "hi": {
                "type": "number"
               }
              }
             },
             "description": "Monthly forecast points, each with its 80% band [lo, hi]."
            },
            "backtest": {
             "type": "array",
             "items": {
              "type": "object",
              "required": [
               "period",
               "actual",
               "predicted"
              ],
              "properties": {
               "period": {
                "type": "string"
               },
               "actual": {
                "type": "number"
               },
               "predicted": {
                "type": "number"
               }
              }
             },
             "description": "Walk-forward backtest pairs behind the reported MAPE."
            },
            "dataUrl": {
             "type": "string"
            }
           }
          }
         },
         "oneOf": [
          {
           "required": [
            "publishedCount",
            "heldBackCount",
            "rows"
           ]
          },
          {
           "required": [
            "series",
            "resolvedIdentifier"
           ]
          }
         ]
        },
        "examples": {
         "one series (global copper price)": {
          "value": {
           "name": "MFG Calcs Forecasts",
           "version": "1.0.0",
           "horizon": 6,
           "measure": "six-month forecast per live series with an empirical band calibrated to an 80% target and the out-of-sample backtest error (MAPE)",
           "gate": "Published only when a series has >= 12 monthly observations and backtest MAPE <= 35%.",
           "caveat": "Statistical extrapolation of the series' own shape via damped Holt-Winters, not a market or policy forecast. It knows nothing about pending Fed decisions, OPEC actions, or Federal Register notices. Read the prediction band and the backtest error (MAPE), not just the central line.",
           "source": "U.S. federal open data (FRED, BLS, EIA, Census, IMF), forecast by MFG Calcs.",
           "license": "CC BY 4.0 with attribution to MFG Calcs.",
           "asOf": "2026-10",
           "url": "https://www.mfgcalcs.com/signals/forecasts/global-copper-price",
           "requested": "global-copper-price",
           "resolvedIdentifier": {
            "key": "globalMaterials.copper",
            "slug": "global-copper-price",
            "title": "Global Copper Price",
            "titleTokens": [
             "global",
             "copper",
             "price"
            ],
            "aliases": [
             "copper price",
             "global copper"
            ]
           },
           "referencePeriod": "2026-09",
           "supportedHorizons": {
            "min": 1,
            "max": 6,
            "unit": "month"
           },
           "series": {
            "key": "globalMaterials.copper",
            "slug": "global-copper-price",
            "title": "Global Copper Price",
            "unit": "USD/tonne",
            "category": "Materials and producer prices",
            "source": "IMF global price via FRED",
            "sourceUrl": "https://fred.stlouisfed.org/series/PCOPPUSDM",
            "latestPeriod": "2026-09",
            "latestValue": 14473.0559,
            "cadence": "monthly",
            "anchorNote": "This series publishes monthly, so the model forecasts directly on it and is anchored on September 2026, the newest month the source has released. Any gap to today is the agency's publication lag, not a stale model.",
            "excludedPeriod": null,
            "excludedValueLabel": null,
            "endValue": 14595.2745,
            "changePct": 0.8,
            "direction": "rising",
            "horizonPeriod": "2027-03",
            "mapePct": 3.4,
            "uncertainty": {
             "status": "forecast",
             "grade": "medium",
             "reason": "Model output, not an observation. Out-of-sample backtest error 3.4%.",
             "lagMonths": 1,
             "stalled": false,
             "errorPct": 3.4,
             "provenanceVerified": true,
             "pinnable": false,
             "scale": "high | medium | low — a grade, not a probability. See /developers."
            },
            "method": "Holt-Winters seasonal, damped",
            "seasonal": true,
            "damped": true,
            "history": [
             {
              "period": "2020-10",
              "value": 6713.811363636364
             },
             {
              "period": "2020-11",
              "value": 7068.907142857143
             },
             {
              "period": "2020-12",
              "value": 7772.238095238095
             },
             {
              "period": "2021-01",
              "value": 7972.1475
             },
             {
              "period": "2021-02",
              "value": 8470.94
             },
             {
              "period": "2021-03",
              "value": 8988.247826086958
             },
             {
              "period": "2021-04",
              "value": 9324.8175
             },
             {
              "period": "2021-05",
              "value": 10166.285
             },
             {
              "period": "2021-06",
              "value": 9631.5
             },
             {
              "period": "2021-07",
              "value": 9450.820454545456
             },
             {
              "period": "2021-08",
              "value": 9370.138571428572
             },
             {
              "period": "2021-09",
              "value": 9324.709545454545
             },
             {
              "period": "2021-10",
              "value": 9829.219047619048
             },
             {
              "period": "2021-11",
              "value": 9728.904545454545
             },
             {
              "period": "2021-12",
              "value": 9551.18
             },
             {
              "period": "2022-01",
              "value": 9782.3375
             },
             {
              "period": "2022-02",
              "value": 9943.175
             },
             {
              "period": "2022-03",
              "value": 10230.89391304348
             },
             {
              "period": "2022-04",
              "value": 10174.34761904762
             },
             {
              "period": "2022-05",
              "value": 9395.027272727273
             },
             {
              "period": "2022-06",
              "value": 9067.551818181819
             },
             {
              "period": "2022-07",
              "value": 7544.809523809524
             },
             {
              "period": "2022-08",
              "value": 7990.812173913043
             },
             {
              "period": "2022-09",
              "value": 7746.011363636364
             },
             {
              "period": "2022-10",
              "value": 7651.082857142857
             },
             {
              "period": "2022-11",
              "value": 8049.861363636364
             },
             {
              "period": "2022-12",
              "value": 8371.091363636364
             },
             {
              "period": "2023-01",
              "value": 9007.346363636363
             },
             {
              "period": "2023-02",
              "value": 8936.587
             },
             {
              "period": "2023-03",
              "value": 8856.310869565217
             },
             {
              "period": "2023-04",
              "value": 8809.1575
             },
             {
              "period": "2023-05",
              "value": 8243.156086956522
             },
             {
              "period": "2023-06",
              "value": 8396.517727272727
             },
             {
              "period": "2023-07",
              "value": 8476.679047619047
             },
             {
              "period": "2023-08",
              "value": 8347.828260869564
             },
             {
              "period": "2023-09",
              "value": 8276.71380952381
             },
             {
              "period": "2023-10",
              "value": 7941.355909090909
             },
             {
              "period": "2023-11",
              "value": 8189.587727272727
             },
             {
              "period": "2023-12",
              "value": 8407.900476190476
             },
             {
              "period": "2024-01",
              "value": 8351.339565217391
             },
             {
              "period": "2024-02",
              "value": 8304.950476190475
             },
             {
              "period": "2024-03",
              "value": 8692.819047619048
             },
             {
              "period": "2024-04",
              "value": 9445.593636363636
             },
             {
              "period": "2024-05",
              "value": 10117.16347826087
             },
             {
              "period": "2024-06",
              "value": 9648.167
             },
             {
              "period": "2024-07",
              "value": 9385.313043478262
             },
             {
              "period": "2024-08",
              "value": 8981.117727272727
             },
             {
              "period": "2024-09",
              "value": 9259.128571428571
             },
             {
              "period": "2024-10",
              "value": 9533.991304347826
             },
             {
              "period": "2024-11",
              "value": 9075.727142857142
             },
             {
              "period": "2024-12",
              "value": 8909.907727272726
             },
             {
              "period": "2025-01",
              "value": 8976.68043478261
             },
             {
              "period": "2025-02",
              "value": 9330.975
             },
             {
              "period": "2025-03",
              "value": 9735.823333333334
             },
             {
              "period": "2025-04",
              "value": 9172.69590909091
             },
             {
              "period": "2025-05",
              "value": 9531.200909090909
             },
             {
              "period": "2025-06",
              "value": 9835.068095238095
             },
             {
              "period": "2025-07",
              "value": 9770.580434782609
             },
             {
              "period": "2025-08",
              "value": 9671.875714285714
             },
             {
              "period": "2025-09",
              "value": 9994.773181818182
             },
             {
              "period": "2025-10",
              "value": 10739.91826086957
             },
             {
              "period": "2025-11",
              "value": 10812.028
             },
             {
              "period": "2025-12",
              "value": 11790.96409090909
             },
             {
              "period": "2026-01",
              "value": 12986.60681818182
             },
             {
              "period": "2026-02",
              "value": 12951.345
             },
             {
              "period": "2026-03",
              "value": 12528.70954545455
             },
             {
              "period": "2026-04",
              "value": 12890.68772727273
             },
             {
              "period": "2026-05",
              "value": 13512.15619047619
             },
             {
              "period": "2026-06",
              "value": 13552.04090909091
             },
             {
              "period": "2026-07",
              "value": 13542.82086956522
             },
             {
              "period": "2026-08",
              "value": 14331.26476190476
             },
             {
              "period": "2026-09",
              "value": 14473.05590909091
             }
            ],
            "forecast": [
             {
              "period": "2026-10",
              "value": 14477.87381246287,
              "lo": 13696.138948712742,
              "hi": 15259.608676213
             },
             {
              "period": "2026-11",
              "value": 14437.545334298939,
              "lo": 13117.213818289754,
              "hi": 15757.876850308123
             },
             {
              "period": "2026-12",
              "value": 14577.652839017652,
              "lo": 12773.529067879424,
              "hi": 16381.77661015588
             },
             {
              "period": "2027-01",
              "value": 14694.22691394397,
              "lo": 12767.358405516336,
              "hi": 16621.095422371603
             },
             {
              "period": "2027-02",
              "value": 14617.213121335219,
              "lo": 12690.344612907584,
              "hi": 16544.081629762855
             },
             {
              "period": "2027-03",
              "value": 14595.274487781608,
              "lo": 11587.553948206903,
              "hi": 17602.99502735631
             }
            ],
            "backtest": [
             {
              "period": "2026-04",
              "actual": 12890.68772727273,
              "predicted": 12645.879430271512
             },
             {
              "period": "2026-05",
              "actual": 13512.15619047619,
              "predicted": 12825.892223394825
             },
             {
              "period": "2026-06",
              "actual": 13552.04090909091,
              "predicted": 13135.955209631044
             },
             {
              "period": "2026-07",
              "actual": 13542.82086956522,
              "predicted": 13267.355741002506
             },
             {
              "period": "2026-08",
              "actual": 14331.26476190476,
              "predicted": 13484.47716572224
             },
             {
              "period": "2026-09",
              "actual": 14473.05590909091,
              "predicted": 14149.2580346772
             }
            ],
            "dataUrl": "https://www.mfgcalcs.com/data/global-copper-price"
           }
          }
         },
         "board (two rows)": {
          "value": {
           "name": "MFG Calcs Forecasts",
           "version": "1.0.0",
           "horizon": 6,
           "measure": "six-month forecast per live series with an empirical band calibrated to an 80% target and the out-of-sample backtest error (MAPE)",
           "gate": "Published only when a series has >= 12 monthly observations and backtest MAPE <= 35%.",
           "caveat": "Statistical extrapolation of the series' own shape via damped Holt-Winters, not a market or policy forecast. It knows nothing about pending Fed decisions, OPEC actions, or Federal Register notices. Read the prediction band and the backtest error (MAPE), not just the central line.",
           "source": "U.S. federal open data (FRED, BLS, EIA, Census, IMF), forecast by MFG Calcs.",
           "license": "CC BY 4.0 with attribution to MFG Calcs.",
           "asOf": "2026-10",
           "url": "https://www.mfgcalcs.com/signals/forecasts",
           "publishedCount": 114,
           "heldBackCount": 8,
           "rows": [
            {
             "slug": "import-volume-tanks-vessels",
             "title": "Tanks, vessels, and gas cylinders Import Customs Value",
             "category": "Tariff Signals",
             "published": true,
             "latestValue": 90615094,
             "endValue": 40533844.8491,
             "changePct": -55.3,
             "direction": "falling",
             "mapePct": 8.3,
             "reason": null,
             "url": "https://www.mfgcalcs.com/signals/forecasts/import-volume-tanks-vessels"
            },
            {
             "slug": "industrial-natural-gas-price",
             "title": "Industrial Natural Gas Price",
             "category": "Energy prices",
             "published": true,
             "latestValue": 4.58,
             "endValue": 6.8959,
             "changePct": 50.6,
             "direction": "rising",
             "mapePct": 10.6,
             "reason": null,
             "url": "https://www.mfgcalcs.com/signals/forecasts/industrial-natural-gas-price"
            }
           ],
           "resultSets": [
            {
             "itemsKey": "rows",
             "returned": 2,
             "available": 122,
             "truncated": true,
             "ranking": null,
             "limit": 2,
             "allItems": "get_forecast(limit:\"all\") or GET /api/forecast?limit=all"
            }
           ]
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/tariff-bill": {
   "get": {
    "operationId": "tariffBill",
    "summary": "Manufacturing Calculated-Duty Estimate",
    "description": "USITC calculated duties across the tracked manufacturing-family panel, monthly since 2014, with annual calculated duties by family. These are estimated statistical duties, not a cash-collections ledger. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "points",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the monthly history: \"all\", \"latest\", or a number of newest points. Default 24."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Manufacturing Calculated-Duty Estimate as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/policy-premium": {
   "get": {
    "operationId": "policyPremium",
    "summary": "Effective-Rate Gap",
    "description": "Pending same-calendar-year coverage. The API returns status=pending, both source vintages, null gaps, and explicit reasons; different-year observations are never mixed. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Effective-Rate Gap as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/tariff-by-country": {
   "get": {
    "operationId": "tariffByCountry",
    "summary": "Tariffs by Country",
    "description": "Per-country tariff summary over one common reporting year for source rows available in the tracked manufacturing-family boards: total and duty-covered customs value, USITC Calculated Duties, observed rate, and boardComplete coverage status. Totals are never all bilateral trade. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Country slug (e.g. china) for one country's detail; omit for the full list."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Tariffs by Country as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/source-shift": {
   "get": {
    "operationId": "sourceShift",
    "summary": "Source-Mix Shift Since 2018",
    "description": "For families with an exact 2018 baseline, the observed #1 source then versus now, China's reported share change, and the largest gainer present at both endpoints. Descriptive, not causal; missing countries are unknown, not zero. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Source-Mix Shift Since 2018 as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/tariff-effect": {
   "get": {
    "operationId": "tariffEffect",
    "summary": "Observed Rate / Import-Value Change",
    "description": "For eligible families with a large observed effective-rate increase, compare import customs value before and after the statistical step. This is value, not volume, and an association rather than a legal-action match or causal estimate. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Observed Rate / Import-Value Change as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/diversification": {
   "get": {
    "operationId": "diversification",
    "summary": "Sourcing Diversification Tracker",
    "description": "The Herfindahl-Hirschman Index of import-source concentration per family, its base-year versus latest reading, and a diversifying / concentrating / steady verdict. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Sourcing Diversification Tracker as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/import-prices": {
   "get": {
    "operationId": "importPrices",
    "summary": "Customs Unit-Value Movers",
    "description": "Aggregate customs unit values (declared customs value / reported quantity) per eligible family over one common adjacent-year pair. Not transaction prices or causal tariff-pass-through measures. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Customs Unit-Value Movers as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/duty-free-routes": {
   "get": {
    "operationId": "dutyFreeRoutes",
    "summary": "Statutory Duty-Free Line Coverage",
    "description": "Unweighted share of tracked HTS lines with literal Free base or reciprocal-program rates. An optional origin applies Column 1 or Column 2 correctly; the endpoint never determines final entry duty. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "country",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Origin country name or slug for applicable Column 1/Column 2 and reciprocal-program coverage."
     },
     {
      "name": "scheduleYear",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Four-digit HTS schedule year. Years not represented by the committed statutory snapshot are declined explicitly."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Statutory Duty-Free Line Coverage as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/wage-board": {
   "get": {
    "operationId": "wageBoard",
    "summary": "Manufacturing Wage Board",
    "description": "Manufacturing wages across 11 production occupations and the 50 states and DC: hourly medians, a state wage index, and per-occupation cross-sections. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "trade",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Occupation key (e.g. welders) for one trade's state board; omit for the summary."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Manufacturing Wage Board as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/forecast-accuracy": {
   "get": {
    "operationId": "forecastAccuracy",
    "summary": "Forecast Accuracy Ledger",
    "description": "The self-graded forecast scoreboard: backtest error by series and horizon, plus realized-vs-predicted grades as published forecasts mature. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Forecast Accuracy Ledger as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/receipts": {
   "get": {
    "operationId": "receipts",
    "summary": "Receipt Archive",
    "description": "The append-only archive of Ed25519-signed data receipts: every value ever signed per series, revisions retained, from the rolling window; permanent yearly ledgers under /data/receipts/. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Series slug (e.g. industrial-electricity-price) for that series' archived receipts; omit for the archived-series catalogue."
     }
    ],
    "responses": {
     "200": {
      "description": "Receipt Archive as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/whats-new": {
   "get": {
    "operationId": "whatsNew",
    "summary": "What Changed Today",
    "description": "The daily digest: every series that published, every value restated, every projection graded, and every Market Wire edition on the newest data day — one call, with links deeper. Empty days are reported empty. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "What Changed Today as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/cost-pressure-index": {
   "get": {
    "operationId": "costPressureIndex",
    "summary": "Cost Pressure Index",
    "description": "The Manufacturing Cost Pressure Index: a composite of input-cost pressure (materials, energy, labor, imports) on U.S. manufacturers, monthly. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "points",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the monthly history: \"all\", \"latest\", or a number of newest points. Default 24."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Cost Pressure Index as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/input-cost-diffusion": {
   "get": {
    "operationId": "inputCostDiffusion",
    "summary": "Input Cost Diffusion Index",
    "description": "What share of tracked manufacturing input costs rose month-over-month — an ISM-style diffusion read on cost breadth. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "points",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the monthly history: \"all\", \"latest\", or a number of newest points. Default 24."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Input Cost Diffusion Index as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/supply-chain-fragility": {
   "get": {
    "operationId": "supplyChainFragility",
    "summary": "Supply Chain Fragility Index",
    "description": "Per-family supply-chain fragility from sourcing concentration, single-country dependence, tariff exposure, and top-source currency volatility; lower-bound flags identify retained-source floors. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Supply Chain Fragility Index as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/state-cost-index": {
   "get": {
    "operationId": "stateCostIndex",
    "summary": "State Cost-to-Manufacture Index",
    "description": "Where manufacturing costs run highest and lowest across the 50 states and DC, from manufacturing wages and industrial electricity, indexed to the national median. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "State name or two-letter code for one state's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "State Cost-to-Manufacture Index as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/cost-pass-through": {
   "get": {
    "operationId": "costPassThrough",
    "summary": "Cost Pass-Through Index",
    "description": "How much of producer input-cost movement shows up in output prices, and with what lag — a statistical read over BLS producer price indexes. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Cost Pass-Through Index as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/manufacturing-pmi": {
   "get": {
    "operationId": "manufacturingPmi",
    "summary": "MFG Calcs PMI",
    "description": "The MFG Calcs PMI: a free, open, reproducible PMI-style diffusion index for U.S. manufacturing built from public federal hard data; check the status field — a provisional month is a renormalized preliminary reading. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "points",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the monthly history: \"all\", \"latest\", or a number of newest points. Default 24."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "MFG Calcs PMI as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/reshoring-break-even": {
   "get": {
    "operationId": "reshoringBreakEven",
    "summary": "Reshoring Break-Even Line",
    "description": "Per family, an indexed crossover rate under an explicit base-year price-parity assumption, compared with the observed effective calculated-duty rate. It is not an absolute domestic-versus-import dollar-cost comparison. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Tariff family key (e.g. steel-fasteners) for one family's detail; omit for the full board."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "Reshoring Break-Even Line as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/provenance": {
   "get": {
    "operationId": "provenance",
    "summary": "Provenance Manifest",
    "description": "SHA-256 provenance for every published index: the exact input files, hashes, and generators, so any reading can be independently verified. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Provenance Manifest as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/tariff-action-ledger": {
   "get": {
    "operationId": "tariffActionLedger",
    "summary": "Observed Effective-Rate Movement Ledger",
    "description": "Month-by-month statistical episodes where the panel's observed effective calculated-duty rate moved, with import-value and Calculated-Duties changes before and after. Not matched to legal actions and not causal. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Observed Effective-Rate Movement Ledger as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/eti-outlook": {
   "get": {
    "operationId": "etiOutlook",
    "summary": "Effective-Tariff Outlook",
    "description": "A six-month damped Holt-Winters extrapolation of the observed Effective-Tariff Index, with an empirical uncertainty band and backtest error. It assumes no structural break, does not encode policy, and does not identify historical moves as legal actions. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Effective-Tariff Outlook as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/vintages": {
   "get": {
    "operationId": "vintages",
    "summary": "Vintage Archive",
    "description": "Point-in-time values: what any tracked series said on a given date, plus the full revision trail for every observation that has been restated. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Series key, e.g. econData:fuels.diesel.history; omit for the catalogue of tracked series."
     },
     {
      "name": "asOf",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ISO date (YYYY-MM-DD). Returns the series as known on that date; omit for the revision trail."
     }
    ],
    "responses": {
     "200": {
      "description": "Vintage Archive as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/cite": {
   "get": {
    "operationId": "cite",
    "summary": "Citation Service",
    "description": "Ready-to-paste citations for any published dataset in APA, Chicago, BibTeX or RIS, each carrying a stable site identifier, version, retrieval date and archived point-in-time URL. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "dataset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Dataset id; omit for the catalogue of citable datasets."
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "apa | chicago | bibtex | ris | json (default json)."
     },
     {
      "name": "accessed",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ISO date to record as the retrieval date; defaults to today."
     }
    ],
    "responses": {
     "200": {
      "description": "Citation Service as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/revisions": {
   "get": {
    "operationId": "revisions",
    "summary": "Revision Record",
    "description": "Every restatement of a published observation — old value, new value and the date it changed — derived from the point-in-time archive so it can never drift from what ?asOf= returns. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Archive series key, e.g. econData:fuels.diesel.history."
     },
     {
      "name": "artifact",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Artifact name, e.g. manufacturingPmi, to see one index's revisions."
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ISO date (YYYY-MM-DD); only restatements on or after it."
     }
    ],
    "responses": {
     "200": {
      "description": "Revision Record as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/events": {
   "get": {
    "operationId": "events",
    "summary": "Change Stream",
    "description": "Every observation published or revised, in order, with a replayable cursor — resume with ?since=<offset> and catch up with no gap and no duplicate. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Offset to resume after; omit to start at the beginning."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Events per page, 1-1000 (default 200)."
     },
     {
      "name": "artifact",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Filter to one artifact, e.g. manufacturingPmi."
     },
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Filter to one archive series key."
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "published | revised."
     }
    ],
    "responses": {
     "200": {
      "description": "Change Stream as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/seasonally-adjusted": {
   "get": {
    "operationId": "seasonallyAdjusted",
    "summary": "Seasonally Adjusted Energy Prices",
    "description": "EIA industrial and commercial energy prices seasonally adjusted with X-13ARIMA-SEATS, spec files published — EIA itself publishes these series unadjusted. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "series",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Series key (e.g. naturalGas); omit for the catalogue."
     }
    ],
    "responses": {
     "200": {
      "description": "Seasonally Adjusted Energy Prices as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/hs-naics": {
   "get": {
    "operationId": "hsNaics",
    "summary": "HS to NAICS Concordance",
    "description": "The Census Bureau's import concordance as a queryable API: map any HTS-10 code to its NAICS industry, or a NAICS industry to its imported inputs and their tariff exposure. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "hts",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "HTS code or prefix (4-10 digits) to map to NAICS."
     },
     {
      "name": "naics",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "6-digit NAICS code for that industry's imported inputs and tariff exposure."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Depth of the returned board: \"all\" or a number. Ranked boards default to the top 15; a board whose order carries no meaning returns whole. See the resultSets block on the response."
     }
    ],
    "responses": {
     "200": {
      "description": "HS to NAICS Concordance as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/optimize-sourcing": {
   "get": {
    "operationId": "optimizeSourcing",
    "summary": "Sourcing-Mix Optimizer",
    "description": "Exact LP-optimal supplier allocation under capacity and diversification constraints, solved by HiGHS with dual prices — call without parameters for usage and a worked example. Keyless JSON; free with attribution (CC BY 4.0). Also available as the matching MCP tool at https://www.mfgcalcs.com/api/mcp.",
    "parameters": [
     {
      "name": "demand",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Units required (positive number)."
     },
     {
      "name": "suppliers",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "URL-encoded JSON array of suppliers: {name, unitCost, tariffPct?, freightPerUnit?, capacity?, country?}."
     },
     {
      "name": "maxSharePct",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Optional cap on any single supplier's share of demand (e.g. 60)."
     }
    ],
    "responses": {
     "200": {
      "description": "Sourcing-Mix Optimizer as JSON, with source citations and a methodology URL."
     },
     "429": {
      "description": "Best-effort function-instance rate limit exceeded; Retry-After is returned."
     }
    }
   }
  },
  "/api/workbook": {
   "post": {
    "operationId": "exportCalculatorScenarioWorkbook",
    "summary": "Export current V2 inputs and calculated scenarios to Excel",
    "description": "Private, no-store XLSX. Active V2 calculators only. The server recomputes supplied numeric inputs; client formulas/results are not accepted. Formula/workbook versions must match the active release. Request limit 128 KiB; combined batch and sensitivity comparisons at most 250 rows. Target and optimization sheets record supplied candidate solutions and do not rerun a solver in Excel. Native field units apply.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "slug": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "formulaVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "workbookVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "inputs": {
          "type": "object",
          "maxProperties": 32,
          "additionalProperties": {
           "type": "number"
          }
         },
         "batch": {
          "type": "array",
          "minItems": 1,
          "maxItems": 250,
          "items": {
           "type": "object",
           "additionalProperties": false,
           "properties": {
            "label": {
             "type": "string",
             "minLength": 1,
             "maxLength": 120
            },
            "inputs": {
             "type": "object",
             "maxProperties": 32,
             "additionalProperties": {
              "type": "number"
             }
            }
           },
           "required": [
            "inputs"
           ]
          }
         },
         "sensitivity": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
           "inputKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 41,
            "items": {
             "type": "number"
            }
           },
           "secondInputKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "secondValues": {
            "type": "array",
            "minItems": 1,
            "maxItems": 41,
            "items": {
             "type": "number"
            }
           }
          },
          "required": [
           "inputKey",
           "values"
          ]
         },
         "goal": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
           "inputKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "outputKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "target": {
            "type": "number"
           },
           "direction": {
            "enum": [
             "atLeast",
             "atMost",
             "equal"
            ]
           },
           "tolerance": {
            "type": "number",
            "minimum": 0
           },
           "candidateInputs": {
            "type": "object",
            "maxProperties": 32,
            "additionalProperties": {
             "type": "number"
            }
           }
          },
          "required": [
           "inputKey",
           "outputKey",
           "target",
           "direction",
           "tolerance",
           "candidateInputs"
          ]
         },
         "optimization": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
           "objectiveKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "direction": {
            "enum": [
             "minimize",
             "maximize"
            ]
           },
           "candidateInputs": {
            "type": "object",
            "maxProperties": 32,
            "additionalProperties": {
             "type": "number"
            }
           }
          },
          "required": [
           "objectiveKey",
           "direction",
           "candidateInputs"
          ]
         }
        },
        "required": [
         "slug",
         "formulaVersion",
         "inputs"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Personalized formula-driven workbook. Cache-Control: private, no-store.",
      "content": {
       "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "400": {
      "description": "Malformed or unsupported request/input."
     },
     "409": {
      "description": "The requested calculation/workbook version has changed."
     },
     "413": {
      "description": "Request exceeds the body limit."
     },
     "422": {
      "description": "Unavailable V2 model or blocked baseline."
     },
     "429": {
      "description": "Rate limit or execution capacity exceeded."
     }
    }
   }
  }
 },
 "externalDocs": {
  "url": "https://www.mfgcalcs.com/developers",
  "description": "Human documentation and MCP setup"
 }
}
