Interfaces

DefineToolOptions<TArgs, TResult>

Interface: DefineToolOptions<TArgs, TResult>

Defined in: src/core/tools.ts:337

Convenience input for defineTool — flatter than Tool itself. Consumers describe the tool inline; the helper assembles schema.

inputSchema is a JSON Schema object (the same one the LLM will see). For tools that take no arguments, pass { type: 'object', properties: {} } or omit and we'll default to that.

Type Parameters

TArgs

TArgs

TResult

TResult

Properties

capabilities?

readonly optional capabilities?: readonly ToolCapability[]

Defined in: src/core/tools.ts:356

Declare what this tool touches (see Tool.capabilities). Consulted only when the configured checker declares it governs them.


checkIn?

readonly optional checkIn?: CheckInDemand<TArgs>

Defined in: src/core/tools.ts:350

Demand a human check-in before this tool runs (see Tool.checkIn). 'always' or a (args, ctx) => boolean predicate.


checkInComponent?

readonly optional checkInComponent?: AskComponent

Defined in: src/core/tools.ts:353

The registered screen component that collects the check-in decision (see Tool.checkInComponent). Requires checkIn.


description

readonly description: string

Defined in: src/core/tools.ts:339


inputSchema?

readonly optional inputSchema?: Readonly<Record<string, unknown>>

Defined in: src/core/tools.ts:340


name

readonly name: string

Defined in: src/core/tools.ts:338


needs?

readonly optional needs?: CredentialNeed

Defined in: src/core/tools.ts:343

Declare a credential this tool needs (declare-and-push). Resolved by the framework before execute and injected as ctx.credential.


resultCeiling?

readonly optional resultCeiling?: ToolResultCeiling

Defined in: src/core/tools.ts:359

Refuse (never truncate) a result over this many chars, teaching the model to narrow (see ToolResultCeiling). Omitted → byte-identical.


wants?

readonly optional wants?: Readonly<Record<string, string>>

Defined in: src/core/tools.ts:347

Declare artifact arguments: arg name → required artifact kind (see Tool.wants). The model passes the art_… ref; the framework resolves it before execute and the handler reads the data.

Methods

execute()

execute(args, ctx): TResult | Promise<TResult>

Defined in: src/core/tools.ts:360

Parameters

args

TArgs

ctx

ToolExecutionContext

Returns

TResult | Promise<TResult>

On this page