{
  "openapi": "3.1.1",
  "info": {
    "title": "Dayweave Team Capacity \u0026 Workload Planner API",
    "version": "1.0.0",
    "summary": "Planned hours vs. working hours per person and day, with time zones and over-allocation warnings.",
    "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://dayweavecapacityplanner.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Planned hours vs. working hours per person and day, with time zones and over-allocation warnings.",
        "description": "Lists each person’s working hours (days, hours, time zone, days away) and their planned meetings and work blocks, then shows per person and day how many hours are available, planned and still free, the load in percent, double bookings and every day that is over-allocated. Paste lines or a whole Dayweave plan.\n\nMethodology:\n- Capacity per day = length of the working hours on a working day (or the daily capacity you give), 0 on other days and on days away.\n- Planned time = the union of the person’s timed items on that local day in their own time zone; double-booked time counts once and each overlapping pair is reported. Items over midnight count on both days. All-day items do not use working time.\n- Load = planned ÷ capacity. Status: free (nothing planned), ok (\u003c 85 %), busy (85–100 %), over (\u003e 100 %, or anything planned on a day without capacity).\n- Local times are converted with the IANA time zone database of the runtime; a time in a daylight-saving gap moves forward by the gap.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "dayweave_capacity_planner",
        "x-owner-app": "dayweave",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DayweaveCapacityPlannerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Product team week across three time zones",
                  "value": {
                    "people": "Ana, Europe/Berlin, Mon-Fri, 09:00-17:00\nBen, Europe/London, Mon-Fri, 08:30-16:30\nChloé, Europe/Berlin, Mon-Thu, 09:00-15:00\nDev, Asia/Kolkata, Mon-Fri, 10:00-18:30, away 2026-12-10..2026-12-11",
                    "items": "Ana, 2026-12-07, 10:00, 11:30, Sprint planning\nBen, 2026-12-07, 10:00, 11:30, Sprint planning\nChloé, 2026-12-07, 10:00, 11:30, Sprint planning\nBen, 2026-12-07, 13:00, 16:00, Checkout API\nChloé, 2026-12-08, 09:00, 12:00, Onboarding screens\nBen, 2026-12-08, 13:00, 16:30, Load test\nBen, 2026-12-08, 15:00, 16:30, Bug bash\nAna, 2026-12-08, 13:00, 17:30, Release notes\nChloé, 2026-12-09, 09:00, 6h, Accessibility fixes\nDev, 2026-12-10, 11:00, 1h, Customer call",
                    "from": "2026-12-07",
                    "to": "2026-12-11"
                  }
                },
                "example2": {
                  "summary": "Part-timer with a 4-hour daily capacity",
                  "value": {
                    "people": "Sam, Europe/Paris, Mon-Fri, 08:00-18:00, 4h",
                    "items": "Sam, 2026-12-07, 09:00, 3h, Reports\nSam, 2026-12-08, 09:00, 5h, Workshop\nSam, 2026-12-09, 14:00, 1h, Call",
                    "from": "2026-12-07",
                    "to": "2026-12-09"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DayweaveCapacityPlannerResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "DayweaveCapacityPlannerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "people": {
            "title": "People (one per line: name, time zone, days, hours[, daily capacity][, away from..to])",
            "description": "Example: Ana, Europe/Berlin, Mon-Fri, 09:00-17:00. Days like Mon-Fri, Tue-Sat or Mon+Wed+Fri. An optional daily capacity such as 6h replaces the length of the hours.",
            "type": "string",
            "maxLength": 20000,
            "default": "Ana, Europe/Berlin, Mon-Fri, 09:00-17:00\nBen, Europe/London, Mon-Fri, 08:30-16:30\nChloé, Europe/Berlin, Mon-Thu, 09:00-15:00\nDev, Asia/Kolkata, Mon-Fri, 10:00-18:30, away 2026-12-10..2026-12-11"
          },
          "items": {
            "title": "Planned items (one per line: person, date, start, end or duration, title)",
            "description": "Times are read in that person’s time zone. The end can be a time (16:30) or a duration (1h30, 90m). An end before the start runs past midnight.",
            "type": "string",
            "maxLength": 400000,
            "default": "Ana, 2026-12-07, 10:00, 11:30, Sprint planning\nBen, 2026-12-07, 10:00, 11:30, Sprint planning\nChloé, 2026-12-07, 10:00, 11:30, Sprint planning\nBen, 2026-12-07, 13:00, 16:00, Checkout API\nChloé, 2026-12-08, 09:00, 12:00, Onboarding screens\nBen, 2026-12-08, 13:00, 16:30, Load test\nBen, 2026-12-08, 15:00, 16:30, Bug bash\nAna, 2026-12-08, 13:00, 17:30, Release notes\nChloé, 2026-12-09, 09:00, 6h, Accessibility fixes\nDev, 2026-12-10, 11:00, 1h, Customer call"
          },
          "from": {
            "title": "From (YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-12-07"
          },
          "to": {
            "title": "To (YYYY-MM-DD, at most 93 days)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-12-11"
          },
          "timeZone": {
            "title": "Time zone for people without one",
            "type": "string",
            "maxLength": 64,
            "default": "Europe/Berlin"
          },
          "plan": {
            "title": "Or a Dayweave plan (JSON, replaces the lines above)",
            "description": "A .dayweave.json file: its people, events and blocks (with repeats) are used.",
            "type": "string",
            "maxLength": 2000000,
            "default": ""
          }
        },
        "required": []
      },
      "DayweaveCapacityPlannerResult": {
        "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"
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}