Skip to content

ToolSpec

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

Type Parameter
I
O
description: string;

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


inputSchema: JsonObjectSchema;

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

Advertised to the model verbatim.


optional isConcurrencySafe?: boolean;

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

The tool may run in parallel with others. Default false, for the same reason as isReadOnly: two writes run at once by omission can race.


optional isReadOnly?: boolean;

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

The tool changes nothing. Default false: a flag that promises safety is true only when the tool says so. repairHistory tells the model an interrupted read-only call “changed nothing, so it is safe to call again”, and a write that left this out used to be told that too.


optional isTerminal?: boolean;

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

A terminal tool ends the run; its validated input is the run’s output.


name: string;

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


optional needsApproval?: boolean;

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


run: (input, ctx) => Promise<O>;

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

Parameter Type
input I
ctx ToolContext

Promise<O>


optional summarize?: (output) => string;

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

How the result reads back to the model. Defaults to JSON.

Parameter Type
output O

string


optional timeoutMs?: number;

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

Default 60s. A tool with no ceiling can hang a whole run.


optional validate?: (raw) => I;

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

Turn raw arguments into I, or throw with a message the MODEL can act on. Omit to accept whatever arrived (the schema is then only a hint).

Parameter Type
raw unknown

I