Skip to content

tool

function tool<TParameters, Context, Result>(options): FunctionTool<Context, TParameters, Result>

Exposes a function to the agent as a tool to be called

Type Parameter Default type

TParameters extends ToolInputParameters

undefined

Context

unknown

Result

string

Parameter Type Description

options

ToolOptions<TParameters, Context>

The options for the tool

FunctionTool<Context, TParameters, Result>

A new tool