API
interface ToolOptionsWithInput<Name extends string, Schema extends s.HashbrownType, Result> {
deps: DependencyList ;
description: string;
handler: (
input: s.Infer <Schema>,
abortSignal: AbortSignal ,
) => Promise <Result>;
name: Name;
schema: Schema;
}
ToolOptionsWithInput
@type
Name
string
@type
Schema
s.HashbrownType
@type
Result
deps
DependencyList
Dependencies that should trigger tool recreation. The hook will automatically memoize the handler based on these dependencies, so you can safely pass anonymous functions.
description
string
The description of the tool. This helps the LLM understand its purpose.
handler
(input: s.Infer<Schema>, abortSignal: AbortSignal) => Promise<Result>
The handler of the tool. This is what the LLM agent will call to execute the tool, passing in an input that adheres to the schema.
name
Name
The name of the tool.
schema
Schema
The schema that describes the input for the tool.