findTool

Finds a specific tool instance from the tool registry based on the provided tool type.

Return

a SafeTool instance corresponding to the found tool in the registry

Parameters

tool

the tool instance whose type is used to search for a corresponding tool in the registry

Throws

if a tool of the provided type is not found in the registry


abstract fun <TArgs, TResult> findTool(toolClass: KClass<out Tool<TArgs, TResult>>): SafeTool<TArgs, TResult>(source)

Finds a tool of the specified class from the tool registry and wraps it in a SafeTool instance.

Return

a SafeTool instance wrapping the found tool

Parameters

toolClass

the class of the tool to search for in the tool registry

Throws

if no tool of the specified class is found in the registry