Tool

class Tool(val name: String, val description: String, val parameters: List<Parameter>, handler: suspend (Map<String, Any>) -> ToolResult)

Represents an executable tool with a defined structure, parameters, and result handler.

Constructors

Link copied to clipboard
constructor(name: String, description: String, parameters: List<Parameter>, handler: suspend (Map<String, Any>) -> ToolResult)

Properties

Link copied to clipboard

A brief description of what the tool does.

Link copied to clipboard

The unique name of the tool.

Link copied to clipboard

A list of Parameter instances specifying the input parameters required by the tool.

Functions

Link copied to clipboard
suspend fun execute(args: Map<String, Any>): ToolResult

Executes the tool using the provided arguments and validates input parameters.