{
  "openapi": "3.1.1",
  "info": {
    "title": "Household Maintenance Calendar API",
    "version": "1.0.0",
    "summary": "A dated home maintenance schedule for your appliances and features, as a calendar file.",
    "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://householdmaintenancecalendar.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "A dated home maintenance schedule for your appliances and features, as a calendar file.",
        "description": "Tick the features of your home — heating, alarms, appliances, gutters, garden, pool, car — and get a dated maintenance plan for up to 24 months, grouped by month, with safety intervals backed by official guidance and a recurring-event calendar file to import.\n\nMethodology:\n- Tasks come from an editorial catalog of generic maintenance best practice; a task is included if it applies to every home, to your home type, or to a feature you ticked.\n- Interval tasks (every N months): the first date is the start date for monthly tasks, and start date + (catalog position × 3 mod 28) days for longer intervals so that work is spread out; then every N months. A first date on the 29th–31st moves to the 28th of the following month so the calendar recurrence is valid in every month.\n- Day-interval tasks (e.g. weekly pool checks) repeat every N days from the start date.\n- Seasonal tasks fall on the 1st of their months (northern hemisphere months; +6 months in the southern hemisphere).\n- Only dates from the start date to the day before start + N months are listed. The .ics file has one all-day recurring VEVENT per task (RRULE FREQ=MONTHLY/DAILY/YEARLY with UNTIL), CRLF line endings, folded lines and UIDs derived from the inputs.\n- Safety intervals (smoke and CO alarm tests and batteries, chimney inspection, septic inspection, tyre pressure) follow the cited official guidance; all other intervals are editorial — your manufacturer’s manual takes precedence.\n\nGeneric reminders, not a substitute for your appliance manuals, local regulations or professional inspections. Do not climb on roofs; hire professionals for gas, electrical and roof work.",
        "tags": [
          "home-travel"
        ],
        "x-mcp-tool": "household_maintenance_calendar",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HouseholdMaintenanceCalendarInput"
              },
              "examples": {
                "example1": {
                  "summary": "Apartment, 12 months",
                  "value": {
                    "homeType": "apartment",
                    "features": [
                      "smoke-detectors",
                      "co-detectors",
                      "gas-heating",
                      "dishwasher",
                      "washing-machine",
                      "fridge"
                    ],
                    "hemisphere": "north",
                    "startDate": "2026-11-01",
                    "months": 12
                  }
                },
                "example2": {
                  "summary": "House with garden, pool and car, 24 months",
                  "value": {
                    "homeType": "house",
                    "features": [
                      "smoke-detectors",
                      "heat-pump",
                      "water-heater",
                      "dryer",
                      "gutters",
                      "chimney",
                      "garden",
                      "pool",
                      "septic",
                      "solar",
                      "car"
                    ],
                    "hemisphere": "north",
                    "startDate": "2026-10-15",
                    "months": 24
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HouseholdMaintenanceCalendarResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "HouseholdMaintenanceCalendarInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "homeType": {
            "title": "Home type",
            "type": "string",
            "enum": [
              "apartment",
              "house",
              "townhouse"
            ],
            "default": "apartment"
          },
          "features": {
            "title": "Your home has",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "gas-heating",
                "heat-pump",
                "ac",
                "smoke-detectors",
                "co-detectors",
                "water-heater",
                "dishwasher",
                "washing-machine",
                "dryer",
                "fridge",
                "gutters",
                "chimney",
                "garden",
                "pool",
                "septic",
                "solar",
                "car"
              ]
            },
            "default": [
              "smoke-detectors",
              "dishwasher",
              "washing-machine",
              "fridge"
            ]
          },
          "hemisphere": {
            "title": "Hemisphere (for seasons)",
            "type": "string",
            "enum": [
              "north",
              "south"
            ],
            "default": "north"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "format": "date"
          },
          "months": {
            "title": "Months to plan",
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "default": 12
          }
        },
        "required": [
          "startDate"
        ]
      },
      "HouseholdMaintenanceCalendarResult": {
        "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": [
              "startDate",
              "endDate",
              "taskCount",
              "occurrenceCount",
              "tasks",
              "occurrences"
            ],
            "properties": {
              "startDate": {
                "type": "string",
                "format": "date"
              },
              "endDate": {
                "type": "string",
                "format": "date"
              },
              "taskCount": {
                "type": "integer",
                "minimum": 0
              },
              "occurrenceCount": {
                "type": "integer",
                "minimum": 0
              },
              "tasks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "title",
                    "category",
                    "interval",
                    "rrule"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "interval": {
                      "type": "string"
                    },
                    "rrule": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "format": "uri"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              },
              "occurrences": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "date",
                    "taskId",
                    "title",
                    "category"
                  ],
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "taskId": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}