Skip to main content
Define a custom tool executed in the SDK process. The schema describes model-facing input. Validate untrusted invocation input inside execute before side effects; schema parsing is not automatic.

Type Parameters

Input

Input = unknown

Output

Output = unknown

Parameters

def

ToolDefinition<Input, Output> Named tool, input schema, and execution callback.

Returns

ToolDefinition<Input, Output> The definition after registration checks, preserving its input/output types.

Throws

A configuration error for missing name, callback, or input schema.

Example