{
  "description": "VirtualMCPCompositeToolDefinition is the Schema for the virtualmcpcompositetooldefinitions API\nVirtualMCPCompositeToolDefinition defines reusable composite workflows that can be referenced\nby multiple VirtualMCPServer instances",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "VirtualMCPCompositeToolDefinitionSpec defines the desired state of VirtualMCPCompositeToolDefinition.\nThis embeds the CompositeToolConfig from pkg/vmcp/config to share the configuration model\nbetween CLI and operator usage.",
      "properties": {
        "description": {
          "description": "Description describes what the workflow does.",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "Name is the workflow name (unique identifier).",
          "type": "string"
        },
        "output": {
          "additionalProperties": false,
          "description": "Output defines the structured output schema for this workflow.\nIf not specified, the workflow returns the last step's output (backward compatible).",
          "properties": {
            "properties": {
              "additionalProperties": {
                "additionalProperties": false,
                "description": "OutputProperty defines a single output property.\nFor non-object types, Value is required.\nFor object types, either Value or Properties must be specified (but not both).",
                "properties": {
                  "default": {
                    "description": "Default is the fallback value if template expansion fails.\nType coercion is applied to match the declared Type.",
                    "x-kubernetes-preserve-unknown-fields": true
                  },
                  "description": {
                    "description": "Description is a human-readable description exposed to clients and models",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "properties": {
                    "description": "Properties defines nested properties for object types.\nEach nested property has full metadata (type, description, value/properties).",
                    "type": [
                      "object",
                      "null"
                    ],
                    "x-kubernetes-preserve-unknown-fields": true
                  },
                  "type": {
                    "description": "Type is the JSON Schema type: \"string\", \"integer\", \"number\", \"boolean\", \"object\", \"array\"",
                    "enum": [
                      "string",
                      "integer",
                      "number",
                      "boolean",
                      "object",
                      "array"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value is a template string for constructing the runtime value.\nFor object types, this can be a JSON string that will be deserialized.\nSupports template syntax: {{.steps.step_id.output.field}}, {{.params.param_name}}",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "type": "object"
              },
              "description": "Properties defines the output properties.\nMap key is the property name, value is the property definition.",
              "type": "object"
            },
            "required": {
              "description": "Required lists property names that must be present in the output.",
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            }
          },
          "required": [
            "properties"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "parameters": {
          "description": "Parameters defines input parameter schema in JSON Schema format.\nShould be a JSON Schema object with \"type\": \"object\" and \"properties\".\nExample:\n  {\n    \"type\": \"object\",\n    \"properties\": {\n      \"param1\": {\"type\": \"string\", \"default\": \"value\"},\n      \"param2\": {\"type\": \"integer\"}\n    },\n    \"required\": [\"param2\"]\n  }\n\nWe use json.Map rather than a typed struct because JSON Schema is highly\nflexible with many optional fields (default, enum, minimum, maximum, pattern,\nitems, additionalProperties, oneOf, anyOf, allOf, etc.). Using json.Map\nallows full JSON Schema compatibility without needing to define every possible\nfield, and matches how the MCP SDK handles inputSchema.",
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-preserve-unknown-fields": true
        },
        "steps": {
          "description": "Steps are the workflow steps to execute.",
          "items": {
            "additionalProperties": false,
            "description": "WorkflowStepConfig defines a single workflow step.\nThis matches the proposal's step configuration (lines 180-255).",
            "properties": {
              "arguments": {
                "description": "Arguments is a map of argument values with template expansion support.\nSupports Go template syntax with .params and .steps for string values.\nNon-string values (integers, booleans, arrays, objects) are passed as-is.\nNote: the templating is only supported on the first level of the key-value pairs.",
                "type": [
                  "object",
                  "null"
                ],
                "x-kubernetes-preserve-unknown-fields": true
              },
              "collection": {
                "description": "Collection is a Go template expression that resolves to a JSON array or a slice.\nOnly used when Type is \"forEach\".",
                "type": [
                  "string",
                  "null"
                ]
              },
              "condition": {
                "description": "Condition is a template expression that determines if the step should execute",
                "type": [
                  "string",
                  "null"
                ]
              },
              "defaultResults": {
                "description": "DefaultResults provides fallback output values when this step is skipped\n(due to condition evaluating to false) or fails (when onError.action is \"continue\").\nEach key corresponds to an output field name referenced by downstream steps.\nRequired if the step may be skipped AND downstream steps reference this step's output.",
                "x-kubernetes-preserve-unknown-fields": true
              },
              "dependsOn": {
                "description": "DependsOn lists step IDs that must complete before this step",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "id": {
                "description": "ID is the unique identifier for this step.",
                "type": "string"
              },
              "itemVar": {
                "description": "ItemVar is the variable name used to reference the current item in forEach templates.\nDefaults to \"item\" if not specified.\nOnly used when Type is \"forEach\".",
                "type": [
                  "string",
                  "null"
                ]
              },
              "maxIterations": {
                "description": "MaxIterations limits the number of items that can be iterated over.\nDefaults to 100, hard cap at 1000.\nOnly used when Type is \"forEach\".",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "maxParallel": {
                "description": "MaxParallel limits the number of concurrent iterations in a forEach step.\nDefaults to the DAG executor's maxParallel (10).\nOnly used when Type is \"forEach\".",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "message": {
                "description": "Message is the elicitation message\nOnly used when Type is \"elicitation\"",
                "type": [
                  "string",
                  "null"
                ]
              },
              "onCancel": {
                "additionalProperties": false,
                "description": "OnCancel defines the action to take when the user cancels/dismisses the elicitation\nOnly used when Type is \"elicitation\"",
                "properties": {
                  "action": {
                    "default": "abort",
                    "description": "Action defines the action to take when the user declines or cancels\n- skip_remaining: Skip remaining steps in the workflow\n- abort: Abort the entire workflow execution\n- continue: Continue to the next step",
                    "enum": [
                      "skip_remaining",
                      "abort",
                      "continue"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "onDecline": {
                "additionalProperties": false,
                "description": "OnDecline defines the action to take when the user explicitly declines the elicitation\nOnly used when Type is \"elicitation\"",
                "properties": {
                  "action": {
                    "default": "abort",
                    "description": "Action defines the action to take when the user declines or cancels\n- skip_remaining: Skip remaining steps in the workflow\n- abort: Abort the entire workflow execution\n- continue: Continue to the next step",
                    "enum": [
                      "skip_remaining",
                      "abort",
                      "continue"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "onError": {
                "additionalProperties": false,
                "description": "OnError defines error handling behavior",
                "properties": {
                  "action": {
                    "default": "abort",
                    "description": "Action defines the action to take on error",
                    "enum": [
                      "abort",
                      "continue",
                      "retry"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "retryCount": {
                    "description": "RetryCount is the maximum number of retries\nOnly used when Action is \"retry\"",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "retryDelay": {
                    "description": "RetryDelay is the delay between retry attempts\nOnly used when Action is \"retry\"",
                    "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "schema": {
                "description": "Schema defines the expected response schema for elicitation",
                "type": [
                  "object",
                  "null"
                ],
                "x-kubernetes-preserve-unknown-fields": true
              },
              "step": {
                "description": "InnerStep defines the step to execute for each item in the collection.\nOnly used when Type is \"forEach\". Only tool-type inner steps are supported.",
                "type": [
                  "object",
                  "null"
                ],
                "x-kubernetes-preserve-unknown-fields": true
              },
              "timeout": {
                "description": "Timeout is the maximum execution time for this step",
                "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                "type": [
                  "string",
                  "null"
                ]
              },
              "tool": {
                "description": "Tool is the tool to call (format: \"workload.tool_name\")\nOnly used when Type is \"tool\"",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "default": "tool",
                "description": "Type is the step type (tool, elicitation, etc.)",
                "enum": [
                  "tool",
                  "elicitation",
                  "forEach"
                ],
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "timeout": {
          "description": "Timeout is the maximum workflow execution time.",
          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "steps"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "description": "VirtualMCPCompositeToolDefinitionStatus defines the observed state of VirtualMCPCompositeToolDefinition",
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observations of the workflow's state",
          "items": {
            "additionalProperties": false,
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the most recent generation observed for this VirtualMCPCompositeToolDefinition\nIt corresponds to the resource's generation, which is updated on mutation by the API Server",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "referencingVirtualServers": {
          "description": "ReferencingVirtualServers lists VirtualMCPServer resources that reference this workflow\nThis helps track which servers need to be reconciled when this workflow changes",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-type": "set"
        },
        "validationErrors": {
          "description": "ValidationErrors contains validation error messages if ValidationStatus is Invalid",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-type": "atomic"
        },
        "validationStatus": {
          "description": "ValidationStatus indicates the validation state of the workflow\n- Valid: Workflow structure is valid\n- Invalid: Workflow has validation errors",
          "enum": [
            "Valid",
            "Invalid",
            "Unknown"
          ],
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}