{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ucp.dev/2026-01-11/schemas/ucp.json",
  "title": "UCP Metadata",
  "description": "Protocol metadata for discovery profiles and responses. Uses slim schema pattern with context-specific required fields.",
  "$defs": {
    "version": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "UCP protocol version in YYYY-MM-DD format."
    },
    "services": {
      "type": "object",
      "description": "Service definitions keyed by reverse-domain service name.",
      "additionalProperties": {
        "$ref": "https://ucp.dev/2026-01-11/schemas/service.json"
      }
    },
    "discovery_profile": {
      "title": "UCP Discovery Profile",
      "description": "Full UCP metadata for /.well-known/ucp discovery.",
      "type": "object",
      "required": [
        "version",
        "services",
        "capabilities"
      ],
      "properties": {
        "version": {
          "$ref": "#/$defs/version"
        },
        "services": {
          "$ref": "#/$defs/services"
        },
        "capabilities": {
          "type": "array",
          "description": "Supported capabilities and extensions.",
          "items": {
            "$ref": "https://ucp.dev/2026-01-11/schemas/capability.json#/$defs/discovery"
          }
        }
      }
    },
    "response_checkout": {
      "title": "UCP Checkout Response",
      "description": "UCP metadata for checkout responses.",
      "type": "object",
      "required": [
        "version",
        "capabilities"
      ],
      "properties": {
        "version": {
          "$ref": "#/$defs/version"
        },
        "capabilities": {
          "type": "array",
          "description": "Active capabilities for this response.",
          "items": {
            "$ref": "https://ucp.dev/2026-01-11/schemas/capability.json#/$defs/response"
          }
        }
      }
    },
    "response_order": {
      "title": "UCP Order Response",
      "description": "UCP metadata for order responses. No payment handlers needed post-purchase.",
      "type": "object",
      "required": [
        "version",
        "capabilities"
      ],
      "properties": {
        "version": {
          "$ref": "#/$defs/version"
        },
        "capabilities": {
          "type": "array",
          "description": "Active capabilities for this response.",
          "items": {
            "$ref": "https://ucp.dev/2026-01-11/schemas/capability.json#/$defs/response"
          }
        }
      }
    }
  }
}