Typed Tool
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
input Type
Class of the input type for JSON deserialization
output Type
Class of the output type (used for documentation)
metadata
Optional tool metadata
object Mapper
ObjectMapper for JSON serialization/deserialization
function
Function that processes typed input and returns typed output