Skip to content

rulvar API reference


rulvar API reference / @rulvar/core / tool

Function: tool()

ts
function tool<S>(init): ToolDef<S>;

Defined in: packages/core/src/tools/tool.ts:42

Defines a tool. Definition-time failures are typed ConfigErrors, never first-call surprises: an illegal name, a Standard Schema without the JSON Schema projection, a recursive local $ref, or a remote/dynamic reference all fail here.

Type Parameters

Type Parameter
S extends SchemaSpec

Parameters

ParameterType
initToolInit&lt;S&gt;

Returns

ToolDef&lt;S&gt;