API
interface ToolOptionsWithUnknownSchema<Name extends string, Result> {
deps: DependencyList ;
description: string;
handler: (input: any, abortSignal: AbortSignal ) =>
Promise <Result>;
name: Name;
schema: object;
}
ToolOptionsWithUnknownSchema
@type
Name
string
@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: any, 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
object
The unknown schema that describes the input for the tool.