{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MCP Iceland catalogue",
  "type": "object",
  "required": [
    "schemaVersion",
    "updatedAt",
    "scope",
    "evidenceNotice",
    "services"
  ],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "updatedAt": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "format": "date"
    },
    "scope": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "evidenceNotice": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "services": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "provider",
          "category",
          "summary",
          "connection",
          "access",
          "actions",
          "provenance",
          "iceland",
          "setup",
          "sources",
          "capabilities",
          "note",
          "lastSourceReview",
          "connectionTest",
          "independentSecurityReview",
          "status",
          "monogram",
          "color"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "provider": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "summary": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "package": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "monogram": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "registryName": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "statusNote": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "connection": {
            "enum": [
              "hosted",
              "local",
              "both"
            ]
          },
          "access": {
            "enum": [
              "none",
              "account",
              "key",
              "mixed",
              "unknown"
            ]
          },
          "actions": {
            "enum": [
              "read",
              "write",
              "unknown"
            ]
          },
          "provenance": {
            "enum": [
              "provider",
              "community",
              "third-party"
            ]
          },
          "status": {
            "enum": [
              "documented",
              "migration"
            ]
          },
          "color": {
            "enum": [
              "blue",
              "orange",
              "purple",
              "red",
              "teal",
              "slate"
            ]
          },
          "iceland": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "enum": [
                "provider",
                "data"
              ]
            }
          },
          "endpoint": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://",
            "format": "uri"
          },
          "setup": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://",
            "format": "uri"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://",
            "format": "uri"
          },
          "recordUrl": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://",
            "format": "uri"
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^https://",
              "format": "uri"
            }
          },
          "capabilities": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "lastSourceReview": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "format": "date"
          },
          "connectionTest": {
            "type": "null",
            "description": "No independent connection test recorded in version 1."
          },
          "independentSecurityReview": {
            "type": "null",
            "description": "No independent security review recorded in version 1."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "migration"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "required": [
                "statusNote"
              ]
            }
          }
        ]
      }
    }
  }
}
