Interfaces

DefineToolOptions<TArgs, TResult>

Interface: DefineToolOptions<TArgs, TResult>

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

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

argumentsFrom?

readonly optional argumentsFrom?: readonly string[]

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

The declared argument grounds — see Tool.argumentsFrom.


capabilities?

readonly optional capabilities?: readonly ToolCapability[]

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

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:907

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:910

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


composedOf?

readonly optional composedOf?: readonly string[]

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

The named ingredient tools this tool calls through ctx.tools — see Tool.composedOf. Drift-checked at agent build, when the catalog is complete. Omitted → nothing checked, byte-identical.


description

readonly description: string

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


gates?

readonly optional gates?: boolean

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

Whether this tool's procedure can raise an approval gate — see Tool.gates. Omitted → nothing declared, byte-identical.


inputSchema?

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

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


name

readonly name: string

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


needs?

readonly optional needs?: CredentialNeed

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

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


owner?

readonly optional owner?: ToolOwner

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

The stamped identity edge — see Tool.owner.


repeatedWhen?

readonly optional repeatedWhen?: "arguments"

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

Fingerprint the repeated-call ledger on arguments alone, ignoring this tool's own result — see Tool.repeatedWhen. Omitted → byte-identical (the ledger keeps comparing results, as always).


resultCeiling?

readonly optional resultCeiling?: ToolResultCeiling

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

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


resultClass?

readonly optional resultClass?: ToolResultClass

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

The declared class of this tool's results — 'triage' or 'inventory' (see Tool.resultClass). Keys the check:semantics per-class rules. Omitted → no class rules.


resultColumns?

readonly optional resultColumns?: Readonly<Record<string, ColumnType | ColumnDeclaration>>

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

What this tool's ROWS contain — column name to type (see Tool.resultColumns). Needs the checkColumnTypes dial too. Omitted → nothing measured, byte-identical.


resultKind?

readonly optional resultKind?: string

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

The artifact kind a PLACED result is minted under, in the consumer's vocabulary (see Tool.resultKind). Omitted → tool-result/<name>, byte-identical.


wants?

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

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

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:944

Parameters

args

TArgs

ctx

ToolExecutionContext

Returns

TResult | Promise<TResult>

On this page