TypedTool

constructor(name: String, description: String, inputType: Class<I>, outputType: Class<O>, metadata: Tool.Metadata = Tool.Metadata.DEFAULT, objectMapper: <Error class: unknown class> = jacksonObjectMapper(), function: Function<I, O>)

Parameters

I

Input type - will be deserialized from JSON

O

Output type - will be serialized to JSON (unless it's already a Tool.Result)

name

Tool name for LLM consumption

description

Tool description for LLM consumption

inputType

Class of the input type for JSON deserialization

outputType

Class of the output type (used for documentation)

metadata

Optional tool metadata

objectMapper

ObjectMapper for JSON serialization/deserialization

function

Function that processes typed input and returns typed output