Skip to content

ToolHandler<InputSchema, ToolContext, Result> ​

ts
type ToolHandler<InputSchema, ToolContext, Result> = (input, context, options) => Result | Promise<Result>;

A tool's execute: gets its validated input, the toolContext, and a signal.

Type Parameters ​

InputSchema ​

InputSchema extends ToolParameters

ToolContext ​

ToolContext = unknown

Result ​

Result = unknown

Parameters ​

input ​

SchemaInfer<InputSchema>

context ​

ToolContext | undefined

options ​

signal ​

AbortSignal

Returns ​

Result | Promise<Result>