asToolType

Converts a Kotlin reflection type (KType) to a corresponding ToolParameterType.

The method analyzes the provided KType object to determine the appropriate ToolParameterType. It supports basic types such as String, Int, Float, and Boolean, as well as more complex types like enumerations and arrays. For enumerations, it extracts the possible enum constants, and for arrays, it recursively determines the type of the array items.

Return

The corresponding ToolParameterType for the provided KType. Throws an IllegalArgumentException or error for unsupported types.