{
  "openapi": "3.1.1",
  "info": {
    "title": "How Long Will It Last? API",
    "version": "1.0.0",
    "summary": "Estimate remaining life of appliances and home components and plan the replacement.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://howlongwillitlast.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Estimate remaining life of appliances and home components and plan the replacement.",
        "description": "Pick an appliance or home component, enter its age, how hard it is used and how well it is maintained. The tool uses the life-expectancy ranges published in InterNACHI's Standard Estimated Life Expectancy Chart for Homes to estimate remaining years, the share of life used, and a replacement planning window.\n\nMethodology:\n- Base range: the YEARS value for the item from InterNACHI's Standard Estimated Life Expectancy Chart for Homes (e.g. '9 to 13'). Single values use the same min and max; 'N+' values are open-ended (only a minimum).\n- Adjusted range = base range × usage multiplier (light 1.15, normal 1.0, heavy 0.8) × maintenance multiplier (regular 1.0, occasional 0.9, neglected 0.75). These multipliers are this tool's own assumptions, not published figures; InterNACHI's values already assume regular recommended maintenance and normal wear and tear.\n- Remaining years = max(0, adjusted min − age) to max(0, adjusted max − age).\n- Life used = age ÷ midpoint of the adjusted range × 100 (open-ended: ÷ adjusted minimum).\n- Status: < 50% early life, 50–80% mid-life, ≥ 80% but below adjusted minimum approaching end, between adjusted min and max within end-of-life range, beyond adjusted max beyond expected life.\n- Replacement window = current year + remaining min … current year + remaining max (rounded to whole years).\n\nLife expectancies are guidelines only, not guarantees or warranties (InterNACHI).",
        "tags": [
          "everyday"
        ],
        "x-mcp-tool": "how_long_will_it_last",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HowLongWillItLastInput"
              },
              "examples": {
                "example1": {
                  "summary": "7-year-old refrigerator, normal use",
                  "value": {
                    "item": "refrigerator",
                    "ageYears": 7,
                    "usage": "normal",
                    "maintenance": "good"
                  }
                },
                "example2": {
                  "summary": "10-year-old water heater, heavy use, occasional maintenance",
                  "value": {
                    "item": "water-heater",
                    "ageYears": 10,
                    "usage": "heavy",
                    "maintenance": "average"
                  }
                },
                "example3": {
                  "summary": "4-year-old washing machine, light use",
                  "value": {
                    "item": "washing-machine",
                    "ageYears": 4,
                    "usage": "light",
                    "maintenance": "good"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HowLongWillItLastResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "HowLongWillItLastInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "item": {
            "title": "Item",
            "type": "string",
            "enum": [
              "air-conditioner-window",
              "trash-compactor",
              "dehumidifier",
              "dishwasher",
              "food-waste-disposal",
              "dryer-vent-plastic",
              "dryer-vent-steel",
              "clothes-dryer",
              "exhaust-fans",
              "freezer",
              "gas-oven",
              "hand-dryer",
              "humidifier-portable",
              "microwave-oven",
              "range-hood",
              "electric-range",
              "gas-range",
              "refrigerator",
              "swamp-cooler",
              "washing-machine",
              "whole-house-vacuum",
              "caulking",
              "paint-exterior",
              "paint-interior",
              "stains",
              "entertainment-center",
              "kitchen-cabinets",
              "countertop-laminate",
              "countertop-cultured-marble",
              "deck-planks",
              "deck-composite",
              "door-vinyl-exterior",
              "door-hollow-core",
              "afci",
              "light-fixtures",
              "propane-backup-generator",
              "service-panel",
              "solar-panels",
              "solar-batteries",
              "electrical-accessories",
              "carpet",
              "laminate-flooring",
              "vinyl-flooring",
              "linoleum",
              "garage-door",
              "garage-door-opener",
              "co-detector",
              "security-system",
              "central-ac",
              "boiler",
              "ceiling-fan",
              "condenser",
              "furnace",
              "gas-fireplace",
              "heat-pump",
              "whole-house-humidifier",
              "thermostat",
              "burner",
              "faucets",
              "fiberglass-tub-shower",
              "tankless-water-heater",
              "shower-doors",
              "sump-pump",
              "toilet-tank-components",
              "water-heater",
              "water-softener",
              "well-pump",
              "roof-asphalt-architectural",
              "roof-asphalt-3-tab",
              "roof-metal",
              "roof-epdm",
              "vinyl-siding",
              "asphalt-driveway",
              "wood-fencing",
              "pool-filter-pump",
              "pool-water-heater",
              "pool-vinyl-liner",
              "windows-double-pane",
              "windows-vinyl",
              "skylights",
              "window-glazing"
            ],
            "default": "refrigerator"
          },
          "ageYears": {
            "title": "Current age",
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "default": 5,
            "x-unit": "years"
          },
          "usage": {
            "title": "Usage intensity",
            "type": "string",
            "enum": [
              "light",
              "normal",
              "heavy"
            ],
            "default": "normal"
          },
          "maintenance": {
            "title": "Maintenance quality",
            "type": "string",
            "enum": [
              "good",
              "average",
              "poor"
            ],
            "default": "good"
          }
        },
        "required": [
          "ageYears"
        ]
      },
      "HowLongWillItLastResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "item",
              "category",
              "publishedYears",
              "publishedMin",
              "publishedMax",
              "openEnded",
              "factor",
              "adjustedMin",
              "adjustedMax",
              "ageYears",
              "remainingMin",
              "remainingMax",
              "lifeUsedPercent",
              "status",
              "replacementWindowStart",
              "replacementWindowEnd"
            ],
            "properties": {
              "item": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "publishedYears": {
                "type": "string",
                "description": "Verbatim value from the InterNACHI chart."
              },
              "publishedMin": {
                "type": "number"
              },
              "publishedMax": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "null for open-ended values like \"20+\"."
              },
              "openEnded": {
                "type": "boolean"
              },
              "factor": {
                "type": "number",
                "description": "Usage multiplier × maintenance multiplier (tool assumption)."
              },
              "adjustedMin": {
                "type": "number"
              },
              "adjustedMax": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "ageYears": {
                "type": "number"
              },
              "remainingMin": {
                "type": "number"
              },
              "remainingMax": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "lifeUsedPercent": {
                "type": "number",
                "description": "Age ÷ midpoint of the adjusted range (÷ adjusted minimum if open-ended) × 100."
              },
              "status": {
                "type": "string",
                "enum": [
                  "early-life",
                  "mid-life",
                  "approaching-end",
                  "within-end-of-life-range",
                  "beyond-expected-life"
                ]
              },
              "replacementWindowStart": {
                "type": "integer",
                "description": "Calendar year when the adjusted minimum life is reached (start budgeting)."
              },
              "replacementWindowEnd": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Calendar year when the adjusted maximum life is reached."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}