{
  "openapi": "3.1.1",
  "info": {
    "title": "Crewdesk API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "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://crewdesk.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "crewdesk-leave-entitlement",
                "crewdesk-working-days",
                "crewdesk-absence-coverage",
                "ruledate"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/crewdesk-leave-entitlement/calculate": {
      "post": {
        "operationId": "calculateCrewdeskLeaveEntitlement",
        "summary": "Annual leave for a year: pro rata for start or end dates, part-time, carry-over with expiry.",
        "description": "Works out how many days of annual leave someone has in a year: the full-time allowance scaled to their working days per week (also when the pattern changes during the year), pro rata for a start or end date in that year (full months like the German BUrlG, or calendar days), rounded the way you choose, plus carried-over days that lapse on a deadline unless they are used first. Add the leave taken and requested to see what is left. Shows the German statutory minimum for comparison.\n\nMethodology:\n- Part-time: the allowance is scaled by working days per week ÷ the days the allowance is meant for (30 days at 5 days → 18 days at 3 days). When the pattern changes during the year, each period counts with its own days, weighted by its calendar days.\n- Pro rata (only when the employment starts or ends inside the year): full months of employment counted from the start day ÷ 12 (15 April–31 December = 8 full months), or employed calendar days ÷ days of the year, or not at all.\n- Rounding “§ 5 BUrlG”: a fraction of at least half a day becomes a full day, a smaller fraction stays as it is. Other modes round to half days or not at all.\n- Carry-over: days carried in are used first by leave taken up to the deadline; what is left lapses after it. Unused days at the end of the year move on up to the maximum.\n- Leave is counted in working days of the person’s pattern without public holidays of the chosen region (as in the working days calculator). The German statutory minimum is 4 weeks: 4 × working days per week, scaled the same way — shown for comparison only.\n\nNot payroll and not legal advice: contracts, collective agreements and local law decide the real entitlement.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "crewdesk_leave_entitlement",
        "x-owner-app": "crewdesk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewdeskLeaveEntitlementInput"
              },
              "examples": {
                "example1": {
                  "summary": "Start on 15 April, 30 days, full-time",
                  "value": {
                    "year": 2026,
                    "allowanceDays": 30,
                    "referenceDaysPerWeek": 5,
                    "startDate": "2026-04-15"
                  }
                },
                "example2": {
                  "summary": "Three-day week, whole year, 5 days carried until 31 March",
                  "value": {
                    "year": 2026,
                    "allowanceDays": 30,
                    "referenceDaysPerWeek": 5,
                    "startDate": "2020-01-01",
                    "workingDays": "Mon-Wed",
                    "carriedIn": 5,
                    "carryOverExpires": "03-31",
                    "leaveTaken": "2026-02-02..2026-02-04\n2026-08-03..2026-08-14",
                    "asOf": "2026-12-01"
                  }
                },
                "example3": {
                  "summary": "Switch from five to four days on 1 July",
                  "value": {
                    "year": 2026,
                    "allowanceDays": 30,
                    "referenceDaysPerWeek": 5,
                    "startDate": "2018-01-01",
                    "workingDays": "Mon-Fri\n2026-07-01: Mon-Thu"
                  }
                },
                "example4": {
                  "summary": "Leaving on 30 June, 28 days, per calendar day, half-day rounding",
                  "value": {
                    "year": 2027,
                    "allowanceDays": 28,
                    "referenceDaysPerWeek": 5,
                    "startDate": "2022-05-01",
                    "endDate": "2027-06-30",
                    "proRata": "days",
                    "rounding": "half"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewdeskLeaveEntitlementResult"
                }
              }
            }
          },
          "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/tools/crewdesk-working-days/calculate": {
      "post": {
        "operationId": "calculateCrewdeskWorkingDays",
        "summary": "Count the working days between two dates with your weekdays and regional public holidays.",
        "description": "Counts the working days from a first to a last day (both included) for your own working pattern — Mon–Fri, a four-day week or shifts — minus the public holidays of your country and state or region (all 16 German states, Austrian and Swiss regions, US states, UK nations and more) and any extra company holidays. Half days at the start or end count 0.5. Lists every holiday and a month-by-month breakdown.\n\nMethodology:\n- Every date from the first to the last day (both included) is a working day when it is one of your working weekdays, not a public holiday of the chosen country and region, and not an extra holiday.\n- Public holidays: Nager.Date entries of type “Public” — nationwide ones plus those of the chosen state or region. Holidays that fall on a day you do not work change nothing.\n- A half first or last day counts 0.5 (a one-day range is 0.5 when either is set).\n- Some holidays apply only in some towns (e.g. Assumption Day in most of Bavaria, the Augsburg Peace Festival); they are named in the warnings — add them as extra holidays where they apply.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "crewdesk_working_days",
        "x-owner-app": "crewdesk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewdeskWorkingDaysInput"
              },
              "examples": {
                "example1": {
                  "summary": "Christmas break in Bavaria",
                  "value": {
                    "from": "2026-12-21",
                    "to": "2027-01-08",
                    "country": "DE",
                    "subdivision": "DE-BY"
                  }
                },
                "example2": {
                  "summary": "Same break in Berlin with Christmas Eve and New Year’s Eve closed",
                  "value": {
                    "from": "2026-12-21",
                    "to": "2027-01-08",
                    "country": "DE",
                    "subdivision": "DE-BE",
                    "extraHolidays": "2026-12-24, Christmas Eve\n2026-12-31, New Year’s Eve"
                  }
                },
                "example3": {
                  "summary": "Four-day week over Easter in Vienna",
                  "value": {
                    "from": "2027-03-22",
                    "to": "2027-04-02",
                    "country": "AT",
                    "subdivision": "AT-9",
                    "workingDays": "Mon-Thu"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewdeskWorkingDaysResult"
                }
              }
            }
          },
          "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/tools/crewdesk-absence-coverage/calculate": {
      "post": {
        "operationId": "calculateCrewdeskAbsenceCoverage",
        "summary": "Check planned absences against minimum staffing per team, with public holidays.",
        "description": "Paste your people with their team and working days, their absences (approved or still requested, half days) and how many people each team needs: the check lists every working day on which a team falls below its minimum, who is away then, and the days with the most people away — before you approve the next request.\n\nMethodology:\n- Each person is available on their working days unless a public holiday of the region or an absence covers the day; half days count 0.5.\n- Requested (pending) absences count as away, so the result shows what approving them would mean.\n- A team falls short on a day when at least one of its members would normally work and fewer people than its minimum are available. A person in several teams counts in each.\n- Busiest days: the dates with the most people away (absences of any status).",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "crewdesk_absence_coverage",
        "x-owner-app": "crewdesk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewdeskAbsenceCoverageInput"
              },
              "examples": {
                "example1": {
                  "summary": "Christmas in a Berlin studio",
                  "value": {
                    "people": "Jonas, Design, Mon-Fri\nLea, Design, Mon-Fri\nPriya, Engineering, Mon-Fri\nFelix, Engineering, Mon-Thu\nAma, Engineering, Mon-Fri",
                    "absences": "Jonas, 2026-12-21..2026-12-23\nLea, 2026-12-21..2026-12-31, pending\nPriya, 2026-12-24..2026-12-31, half-start\nFelix, 2026-12-21..2026-12-30, pending\nAma, 2026-12-28..2027-01-08",
                    "minimums": "Design: 1\nEngineering: 2",
                    "from": "2026-12-21",
                    "to": "2027-01-08",
                    "country": "DE",
                    "subdivision": "DE-BE"
                  }
                },
                "example2": {
                  "summary": "Bookshop Tuesday to Saturday, three people on the floor",
                  "value": {
                    "people": "Eva, Floor, Tue-Sat\nJan, Floor, Tue-Sat\nMia, Floor, Thu-Sat\nOlli, Floor, Tue-Sat",
                    "absences": "Jan, 2026-12-08..2026-12-12\nMia, 2026-12-10..2026-12-12, pending",
                    "minimums": "Floor: 3",
                    "from": "2026-12-07",
                    "to": "2026-12-19",
                    "country": "DE",
                    "subdivision": "DE-NW"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewdeskAbsenceCoverageResult"
                }
              }
            }
          },
          "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/tools/ruledate/calculate": {
      "post": {
        "operationId": "calculateRuledate",
        "summary": "Business-day and deadline maths with public holidays and a step-by-step rule trace.",
        "description": "Chain date operations (add business days, add months with clamping, end of month, roll to next business day) on a start date. RuleDate uses public holidays for 16 countries and their subdivisions (2024–2030) and shows every skipped date with its reason, so the result can be checked rather than trusted.\n\nMethodology:\n- A business day is a day that is not a selected weekend day, not a public holiday of the chosen country (nationwide, or of the chosen subdivision) and not an extra closure date. Only Nager.Date entries of type \"Public\" count; bank, school, optional and observance days are ignored.\n- Add business days counts business days after the start date (the start date itself is not counted); negative amounts count backwards. Every non-business day passed over is listed with all its reasons.\n- Add calendar days / weeks ignore holidays. Add months keeps the day of month; if it does not exist, \"clamp\" uses the month’s last day and \"overflow\" rolls into the next month.\n- End of month moves to the last calendar day of the month that is `amount` months after the current date. Next / previous business day roll only if the current date is not a business day (following / preceding convention).\n- Optional final rule modelled on § 193 BGB: if the result falls on a Saturday, Sunday or a public holiday at the chosen place, it moves to the next day that is none of these (extra closures and custom weekends are ignored for this rule).\n- Holiday data covers 2024–2030; dates outside that range are checked for weekends and closures only and trigger a warning.\n\nNot legal advice. Statutory and contractual deadlines have their own rules (start-day exclusion, service dates, court holidays, local holidays); verify critical deadlines with a qualified professional.",
        "tags": [
          "developer"
        ],
        "x-mcp-tool": "ruledate",
        "x-owner-app": "opsdeck",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuledateInput"
              },
              "examples": {
                "example1": {
                  "summary": "10 business days from 25 Sep 2026 in Bavaria",
                  "value": {
                    "startDate": "2026-09-25",
                    "operations": [
                      {
                        "op": "add-business-days",
                        "amount": 10
                      }
                    ],
                    "country": "DE",
                    "subdivision": "DE-BY"
                  }
                },
                "example2": {
                  "summary": "5 business days over Christmas in England, then end of month",
                  "value": {
                    "startDate": "2026-12-21",
                    "operations": [
                      {
                        "op": "add-business-days",
                        "amount": 5
                      },
                      {
                        "op": "end-of-month",
                        "amount": 0
                      },
                      {
                        "op": "previous-business-day"
                      }
                    ],
                    "country": "GB",
                    "subdivision": "GB-ENG"
                  }
                },
                "example3": {
                  "summary": "31 Aug + 1 month (clamped) + 3 days, § 193 BGB adjustment",
                  "value": {
                    "startDate": "2026-08-31",
                    "operations": [
                      {
                        "op": "add-months",
                        "amount": 1
                      },
                      {
                        "op": "add-calendar-days",
                        "amount": 3
                      }
                    ],
                    "country": "DE",
                    "finalRule": "bgb193"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuledateResult"
                }
              }
            }
          },
          "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/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "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"
                }
              }
            }
          }
        }
      },
      "CrewdeskLeaveEntitlementInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "year": {
            "title": "Year",
            "type": "number",
            "minimum": 1990,
            "maximum": 2100,
            "default": 2026
          },
          "allowanceDays": {
            "title": "Yearly allowance (full-time days)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 30
          },
          "referenceDaysPerWeek": {
            "title": "The allowance is for … working days a week",
            "type": "number",
            "minimum": 1,
            "maximum": 7,
            "default": 5
          },
          "startDate": {
            "title": "Start of employment (optional)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-04-15"
          },
          "endDate": {
            "title": "End of employment (optional)",
            "type": "string",
            "maxLength": 10,
            "default": ""
          },
          "workingDays": {
            "title": "Working days (or lines “YYYY-MM-DD: Mon-Thu” for changes)",
            "description": "One pattern such as Mon-Fri, or a pattern per period: first line the pattern at the start, then “2026-07-01: Mon-Thu”.",
            "type": "string",
            "maxLength": 1000,
            "default": "Mon-Fri"
          },
          "proRata": {
            "title": "Part of a year counts",
            "type": "string",
            "enum": [
              "months",
              "days",
              "none"
            ],
            "default": "months"
          },
          "rounding": {
            "title": "Rounding",
            "type": "string",
            "enum": [
              "burlg",
              "half",
              "up-half",
              "none"
            ],
            "default": "burlg"
          },
          "accrual": {
            "title": "Earned",
            "type": "string",
            "enum": [
              "yearly",
              "monthly"
            ],
            "default": "yearly"
          },
          "carriedIn": {
            "title": "Days carried over from last year",
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "default": 0
          },
          "carryOverExpires": {
            "title": "Carried days lapse after (MM-DD, empty = never)",
            "type": "string",
            "maxLength": 5,
            "default": "03-31"
          },
          "carryOverMaxDays": {
            "title": "At most … days move on to next year",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 5
          },
          "leaveTaken": {
            "title": "Leave taken (one range per line)",
            "description": "2026-03-02..2026-03-06 or a single date. Counted in working days with the holidays below.",
            "type": "string",
            "maxLength": 20000,
            "default": ""
          },
          "leavePlanned": {
            "title": "Leave requested, not yet approved (one range per line)",
            "type": "string",
            "maxLength": 20000,
            "default": ""
          },
          "asOf": {
            "title": "As of (YYYY-MM-DD, empty = end of the year)",
            "type": "string",
            "maxLength": 10,
            "default": ""
          },
          "country": {
            "title": "Country for public holidays (optional)",
            "type": "string",
            "maxLength": 4,
            "default": "DE"
          },
          "subdivision": {
            "title": "State or region (optional)",
            "description": "ISO 3166-2 code such as DE-BY (Bavaria), DE-BE (Berlin), AT-9 (Vienna), CH-ZH or US-CA. Without it only nationwide holidays count.",
            "type": "string",
            "maxLength": 6,
            "default": "DE-BE"
          },
          "extraHolidays": {
            "title": "Extra holidays (YYYY-MM-DD, name per line)",
            "type": "string",
            "maxLength": 6000,
            "default": ""
          }
        },
        "required": []
      },
      "CrewdeskLeaveEntitlementResult": {
        "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",
            "required": [
              "entitlement",
              "available",
              "afterPlanned",
              "carryUsed",
              "carryLapsed"
            ],
            "properties": {
              "entitlement": {
                "type": "object"
              },
              "available": {
                "type": "number"
              },
              "afterPlanned": {
                "type": "number"
              },
              "carryUsed": {
                "type": "number"
              },
              "carryLapsed": {
                "type": "number"
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "CrewdeskWorkingDaysInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "title": "First day (YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-12-21"
          },
          "to": {
            "title": "Last day (YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": "2027-01-08"
          },
          "country": {
            "title": "Country (two letters)",
            "type": "string",
            "maxLength": 4,
            "default": "DE"
          },
          "subdivision": {
            "title": "State or region (optional)",
            "description": "ISO 3166-2 code such as DE-BY (Bavaria), DE-BE (Berlin), AT-9 (Vienna), CH-ZH or US-CA. Without it only nationwide holidays count.",
            "type": "string",
            "maxLength": 6,
            "default": "DE-BY"
          },
          "workingDays": {
            "title": "Working days",
            "description": "Mon-Fri, Mon-Thu, Tue-Sat or Mon+Wed+Fri.",
            "type": "string",
            "maxLength": 40,
            "default": "Mon-Fri"
          },
          "halfFrom": {
            "title": "The first day counts half",
            "type": "boolean",
            "default": false
          },
          "halfTo": {
            "title": "The last day counts half",
            "type": "boolean",
            "default": false
          },
          "extraHolidays": {
            "title": "Extra holidays (one per line: YYYY-MM-DD, name)",
            "description": "Company closing days or local holidays that are not in the national data, e.g. 2026-12-24, Christmas Eve.",
            "type": "string",
            "maxLength": 6000,
            "default": ""
          }
        },
        "required": []
      },
      "CrewdeskWorkingDaysResult": {
        "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",
            "required": [
              "workingDays",
              "calendarDays",
              "holidays",
              "byMonth"
            ],
            "properties": {
              "workingDays": {
                "type": "number"
              },
              "calendarDays": {
                "type": "integer"
              },
              "holidays": {
                "type": "array"
              },
              "byMonth": {
                "type": "array"
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "CrewdeskAbsenceCoverageInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "people": {
            "title": "People (one per line: name, team, working days)",
            "description": "Someone in several teams: separate the teams with a slash, e.g. “Eva, Office/Floor, Tue-Sat”.",
            "type": "string",
            "maxLength": 20000,
            "default": "Jonas, Design, Mon-Fri\nLea, Design, Mon-Fri\nPriya, Engineering, Mon-Fri\nFelix, Engineering, Mon-Thu\nAma, Engineering, Mon-Fri"
          },
          "absences": {
            "title": "Absences (one per line: name, YYYY-MM-DD..YYYY-MM-DD[, pending][, half-start][, half-end])",
            "description": "“pending” marks a request that is not approved yet; it counts as away so you see what approving it would do.",
            "type": "string",
            "maxLength": 100000,
            "default": "Jonas, 2026-12-21..2026-12-23\nLea, 2026-12-21..2026-12-31, pending\nPriya, 2026-12-24..2026-12-31, half-start\nFelix, 2026-12-21..2026-12-30, pending\nAma, 2026-12-28..2027-01-08"
          },
          "minimums": {
            "title": "Minimum staffing (one per line: team: number)",
            "type": "string",
            "maxLength": 4000,
            "default": "Design: 1\nEngineering: 2"
          },
          "from": {
            "title": "From (YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-12-21"
          },
          "to": {
            "title": "To (YYYY-MM-DD, at most 93 days)",
            "type": "string",
            "maxLength": 10,
            "default": "2027-01-08"
          },
          "country": {
            "title": "Country for public holidays (optional)",
            "type": "string",
            "maxLength": 4,
            "default": "DE"
          },
          "subdivision": {
            "title": "State or region (optional)",
            "description": "ISO 3166-2 code such as DE-BY (Bavaria), DE-BE (Berlin), AT-9 (Vienna), CH-ZH or US-CA. Without it only nationwide holidays count.",
            "type": "string",
            "maxLength": 6,
            "default": "DE-BE"
          },
          "extraHolidays": {
            "title": "Extra holidays (YYYY-MM-DD, name per line)",
            "type": "string",
            "maxLength": 6000,
            "default": ""
          }
        },
        "required": []
      },
      "CrewdeskAbsenceCoverageResult": {
        "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",
            "required": [
              "shortfalls",
              "busiestDays",
              "awayDays"
            ],
            "properties": {
              "shortfalls": {
                "type": "array"
              },
              "busiestDays": {
                "type": "array"
              },
              "awayDays": {
                "type": "array"
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "RuledateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "startDate": {
            "title": "Start date",
            "type": "string",
            "format": "date"
          },
          "operations": {
            "title": "Operations (applied in order)",
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "op": {
                  "title": "Operation",
                  "type": "string",
                  "enum": [
                    "add-business-days",
                    "add-calendar-days",
                    "add-weeks",
                    "add-months",
                    "end-of-month",
                    "next-business-day",
                    "previous-business-day"
                  ]
                },
                "amount": {
                  "title": "Amount",
                  "description": "Negative values go backwards.",
                  "type": "integer",
                  "minimum": -3650,
                  "maximum": 3650,
                  "default": 0
                }
              },
              "required": [
                "op"
              ]
            }
          },
          "country": {
            "title": "Holiday calendar",
            "type": "string",
            "enum": [
              "none",
              "DE",
              "AT",
              "CH",
              "US",
              "GB",
              "FR",
              "NL",
              "BE",
              "ES",
              "IT",
              "PL",
              "SE",
              "DK",
              "IE",
              "CA",
              "AU"
            ],
            "default": "DE"
          },
          "subdivision": {
            "title": "Subdivision (optional)",
            "description": "ISO 3166-2 code, e.g. DE-BY (Bavaria), CH-ZH, US-CA. Without it only nationwide holidays count.",
            "type": "string",
            "maxLength": 10
          },
          "weekendDays": {
            "title": "Weekend days",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sun",
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat"
              ]
            },
            "default": [
              "sat",
              "sun"
            ]
          },
          "closures": {
            "title": "Extra closure dates",
            "description": "One YYYY-MM-DD per line (company holidays, bridge days).",
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 366
          },
          "monthEndRule": {
            "title": "Month arithmetic",
            "type": "string",
            "enum": [
              "clamp",
              "overflow"
            ],
            "default": "clamp"
          },
          "finalRule": {
            "title": "Final adjustment",
            "type": "string",
            "enum": [
              "none",
              "bgb193"
            ],
            "default": "none"
          }
        },
        "required": [
          "startDate",
          "operations"
        ]
      },
      "RuledateResult": {
        "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",
              "finalDate",
              "finalWeekday",
              "country",
              "subdivision",
              "weekendDays",
              "steps",
              "holidaysApplied",
              "dataRange",
              "outsideDataRange"
            ],
            "properties": {
              "startDate": {
                "type": "string",
                "format": "date"
              },
              "finalDate": {
                "type": "string",
                "format": "date"
              },
              "finalWeekday": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "subdivision": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "weekendDays": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "step",
                    "operation",
                    "amount",
                    "from",
                    "to",
                    "skipped",
                    "note"
                  ],
                  "properties": {
                    "step": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "operation": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "integer"
                    },
                    "from": {
                      "type": "string",
                      "format": "date"
                    },
                    "to": {
                      "type": "string",
                      "format": "date"
                    },
                    "note": {
                      "type": "string"
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "date",
                          "weekday",
                          "reasons"
                        ],
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "weekday": {
                            "type": "string"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "holidaysApplied": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "date",
                    "name",
                    "localName",
                    "scope"
                  ],
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "name": {
                      "type": "string"
                    },
                    "localName": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    }
                  }
                }
              },
              "dataRange": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "firstYear",
                  "lastYear"
                ],
                "properties": {
                  "firstYear": {
                    "type": "integer"
                  },
                  "lastYear": {
                    "type": "integer"
                  }
                }
              },
              "outsideDataRange": {
                "type": "boolean"
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}