{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algenta-ai/json-schema/algenta-ai-capability-route-plan-schema.json",
  "title": "CapabilityRoutePlan",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algenta-ai-capability-plane-api-openapi.yml#/components/schemas/CapabilityRoutePlan",
  "properties": {
    "selected_capability_id": {
      "type": "string",
      "title": "Selected Capability Id"
    },
    "selected_provider_id": {
      "type": "string",
      "title": "Selected Provider Id"
    },
    "selected_binding_id": {
      "type": "string",
      "title": "Selected Binding Id"
    },
    "kind": {
      "$ref": "#/$defs/CapabilityKind"
    },
    "execution_owner": {
      "$ref": "#/$defs/ExecutionOwner"
    },
    "requires_approval": {
      "type": "boolean",
      "title": "Requires Approval"
    },
    "confidence": {
      "type": "number",
      "title": "Confidence"
    },
    "reason": {
      "type": "string",
      "title": "Reason"
    },
    "fallbacks": {
      "items": {
        "$ref": "#/$defs/CapabilityRouteFallback"
      },
      "type": "array",
      "title": "Fallbacks"
    },
    "policy_snapshot_id": {
      "type": "string",
      "title": "Policy Snapshot Id"
    },
    "selected_tool_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Selected Tool Name"
    },
    "instruction_artifact_ref": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instruction Artifact Ref"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "selected_capability_id",
    "selected_provider_id",
    "selected_binding_id",
    "kind",
    "execution_owner",
    "requires_approval",
    "confidence",
    "reason",
    "policy_snapshot_id"
  ],
  "$defs": {
    "CapabilityKind": {
      "type": "string",
      "enum": [
        "dataset",
        "mcp_tool",
        "mcp_resource",
        "mcp_prompt",
        "skill",
        "native_tool",
        "runtime_library"
      ],
      "title": "CapabilityKind"
    },
    "CapabilityRouteFallback": {
      "properties": {
        "capability_id": {
          "type": "string",
          "title": "Capability Id"
        },
        "provider_id": {
          "type": "string",
          "title": "Provider Id"
        },
        "binding_id": {
          "type": "string",
          "title": "Binding Id"
        },
        "kind": {
          "$ref": "#/$defs/CapabilityKind"
        },
        "execution_owner": {
          "$ref": "#/$defs/ExecutionOwner"
        },
        "confidence": {
          "type": "number",
          "title": "Confidence"
        },
        "reason": {
          "type": "string",
          "title": "Reason"
        },
        "selected_tool_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Selected Tool Name"
        },
        "instruction_artifact_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Instruction Artifact Ref"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "capability_id",
        "provider_id",
        "binding_id",
        "kind",
        "execution_owner",
        "confidence",
        "reason"
      ],
      "title": "CapabilityRouteFallback"
    },
    "ExecutionOwner": {
      "type": "string",
      "enum": [
        "algenta_managed",
        "client_managed"
      ],
      "title": "ExecutionOwner"
    }
  }
}