{
  "openapi": "3.1.1",
  "info": {
    "title": "Dayweave ICS File Validator (iCalendar) API",
    "version": "1.0.0",
    "summary": "Check an .ics calendar file against RFC 5545 and preview the next dates of every event.",
    "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://dayweaveicsvalidator.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Check an .ics calendar file against RFC 5545 and preview the next dates of every event.",
        "description": "Paste the text of an .ics file: the validator checks its structure (BEGIN/END, content lines, folding, CRLF), required properties (VERSION, PRODID, UID, DTSTAMP), duplicates, time zones without VTIMEZONE, dates, durations and recurrence rules, and lists every event with its time zone and next occurrences — the same reader Dayweave uses for its calendar import.\n\nMethodology:\n- Lines are unfolded (a line starting with a space or tab continues the previous one) and split into NAME;PARAM=value:VALUE content lines; components must nest with matching BEGIN/END.\n- Errors: missing VCALENDAR, VERSION:2.0 or PRODID, VEVENT without UID or DTSTAMP, single-value properties given twice, unreadable dates, DTEND before DTSTART, DTEND together with DURATION, recurrence rules outside the supported subset. Warnings: LF-only line ends, lines over 75 octets, TZIDs without VTIMEZONE, repeated UIDs, cancelled events and changed single occurrences (RECURRENCE-ID).\n- Times with Z are UTC; TZID times use that IANA zone (or the X-LIC-LOCATION of a VTIMEZONE with a Windows name); floating times are read in the zone you choose. The preview expands each event with the Dayweave recurrence engine.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "dayweave_ics_validator",
        "x-owner-app": "dayweave",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DayweaveIcsValidatorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Team calendar with a repeating stand-up and a missing DTSTAMP",
                  "value": {
                    "ics": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Example//Team calendar//EN\r\nBEGIN:VEVENT\r\nUID:standup-1@example.org\r\nDTSTAMP:20261201T080000Z\r\nDTSTART;TZID=Europe/Berlin:20261207T093000\r\nDTEND;TZID=Europe/Berlin:20261207T094500\r\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\r\nEXDATE;TZID=Europe/Berlin:20261224T093000\r\nSUMMARY:Daily stand-up\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:launch@example.org\r\nDTSTART:20261210T140000Z\r\nDURATION:PT2H\r\nSUMMARY:Launch review\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:holiday@example.org\r\nDTSTAMP:20261201T080000Z\r\nDTSTART;VALUE=DATE:20261225\r\nSUMMARY:Office closed\r\nEND:VEVENT\r\nEND:VCALENDAR"
                  }
                },
                "example2": {
                  "summary": "Broken file: unclosed event and an unsupported rule",
                  "value": {
                    "ics": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//x//y//EN\r\nBEGIN:VEVENT\r\nUID:a\r\nDTSTAMP:20261201T000000Z\r\nDTSTART:20261207T090000Z\r\nRRULE:FREQ=HOURLY\r\nSUMMARY:Ping\r\nEND:VCALENDAR"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DayweaveIcsValidatorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "DayweaveIcsValidatorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ics": {
            "title": "Calendar file text (.ics)",
            "type": "string",
            "maxLength": 2000000,
            "default": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Example//Team calendar//EN\r\nBEGIN:VEVENT\r\nUID:standup-1@example.org\r\nDTSTAMP:20261201T080000Z\r\nDTSTART;TZID=Europe/Berlin:20261207T093000\r\nDTEND;TZID=Europe/Berlin:20261207T094500\r\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\r\nEXDATE;TZID=Europe/Berlin:20261224T093000\r\nSUMMARY:Daily stand-up\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:launch@example.org\r\nDTSTART:20261210T140000Z\r\nDURATION:PT2H\r\nSUMMARY:Launch review\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:holiday@example.org\r\nDTSTAMP:20261201T080000Z\r\nDTSTART;VALUE=DATE:20261225\r\nSUMMARY:Office closed\r\nEND:VEVENT\r\nEND:VCALENDAR"
          },
          "timeZone": {
            "title": "Time zone for floating times and the preview",
            "type": "string",
            "maxLength": 64,
            "default": "Europe/Berlin"
          },
          "from": {
            "title": "Preview occurrences from (YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": "2026-12-07"
          },
          "nextCount": {
            "title": "Occurrences per event",
            "type": "number",
            "minimum": 1,
            "maximum": 10,
            "default": 3
          }
        },
        "required": []
      },
      "DayweaveIcsValidatorResult": {
        "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"
              }
            }
          }
        }
      }
    }
  }
}