findTool
inline fun <TArgs : Tool.Args, TResult : ToolResult> findTool(toolClass: KClass<out Tool<TArgs, TResult>>): SafeTool<TArgs, TResult>(source)
Finds and retrieves a tool of the specified type from the tool registry.
Return
A SafeTool instance wrapping the found tool and its environment.
Parameters
TArgs
The type of arguments the tool accepts, extending from Tool.Args.
TResult
The type of result the tool produces, extending from ToolResult.
toolClass
The KClass reference that specifies the type of tool to find.
Throws
if the specified tool is not found in the tool registry.
Finds and retrieves a tool of the specified type from the current stage of the tool registry. If no tool of the given type is found, an exception is thrown.
Return
An instance of SafeTool wrapping the tool of the specified type and the current environment.
Throws
if a tool of the given type is not defined in the tool registry.