{
  "openapi": "3.1.1",
  "info": {
    "title": "Life Admin Generator API",
    "version": "1.0.0",
    "summary": "A dated to-do list for moving, marriage, a baby, a new job and other life events.",
    "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://lifeadmingenerator.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "A dated to-do list for moving, marriage, a baby, a new job and other life events.",
        "description": "Choose a life event, your country, the date and your circumstances. You get a personalised before / on-the-day / after checklist with due dates. Legal deadlines are only stated where verified against official sources (e.g. German Anmeldung within two weeks); everything else is clearly marked as a recommendation.\n\nMethodology:\n- A rule catalog maps each life event to tasks with an offset in days relative to the event date (negative = before). Rules can be limited to countries and to circumstances (e.g. lease notice only when renting).\n- Due date = event date + offset (calendar days). Items are grouped into before, on the day and after, sorted by due date then id.\n- Country-specific legal deadlines are only included where verified against an official source (Germany: BMG § 17, PStG §§ 18 and 28; Austria: oesterreich.gv.at; Switzerland: ch.ch; UK: GOV.UK birth and death registration). Only those are marked mandatory and cited.\n- For other countries and topics the item is phrased as \"check local requirements\"; offsets for recommendations are editorial planning suggestions.\n\nOrganisational help, not legal advice. Rules change and have exceptions — confirm deadlines with the responsible authority.",
        "tags": [
          "everyday"
        ],
        "x-mcp-tool": "life_admin_generator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifeAdminGeneratorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Moving home in Germany (renting, car)",
                  "value": {
                    "event": "moving",
                    "country": "de",
                    "eventDate": "2026-12-01",
                    "circumstances": [
                      "renting",
                      "has-car",
                      "employed"
                    ]
                  }
                },
                "example2": {
                  "summary": "Having a baby in the UK",
                  "value": {
                    "event": "baby",
                    "country": "uk",
                    "eventDate": "2027-03-20",
                    "circumstances": [
                      "employed",
                      "has-car"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifeAdminGeneratorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "LifeAdminGeneratorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "event": {
            "title": "Life event",
            "type": "string",
            "enum": [
              "moving",
              "marriage",
              "new-job",
              "baby",
              "university",
              "retiring",
              "death",
              "car",
              "pet",
              "abroad"
            ]
          },
          "country": {
            "title": "Country",
            "type": "string",
            "enum": [
              "de",
              "at",
              "ch",
              "uk",
              "us",
              "other"
            ],
            "default": "de"
          },
          "eventDate": {
            "title": "Date of the event",
            "description": "Moving day, wedding, first working day, due date, date of death…",
            "type": "string",
            "format": "date"
          },
          "circumstances": {
            "title": "Your situation",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "renting",
                "owning",
                "has-car",
                "has-children",
                "employed",
                "self-employed",
                "has-pets"
              ]
            }
          }
        },
        "required": [
          "event",
          "eventDate"
        ]
      },
      "LifeAdminGeneratorResult": {
        "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": [
              "event",
              "country",
              "eventDate",
              "items",
              "mandatoryCount"
            ],
            "properties": {
              "event": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "eventDate": {
                "type": "string",
                "format": "date"
              },
              "mandatoryCount": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "title",
                    "due",
                    "phase",
                    "daysFromEvent",
                    "category",
                    "mandatory"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "due": {
                      "type": "string",
                      "format": "date"
                    },
                    "phase": {
                      "type": "string",
                      "enum": [
                        "before",
                        "on-the-day",
                        "after"
                      ]
                    },
                    "daysFromEvent": {
                      "type": "integer"
                    },
                    "category": {
                      "type": "string"
                    },
                    "mandatory": {
                      "type": "boolean",
                      "description": "True only for legal duties verified against the cited official source."
                    },
                    "source": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "title",
                        "url"
                      ],
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "note": {
                      "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"
              }
            }
          }
        }
      }
    }
  }
}