ToolSpec
Defined in: core/src/tools.ts:39
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
I |
O |
Properties
Section titled “Properties”description
Section titled “description”description: string;Defined in: core/src/tools.ts:41
inputSchema
Section titled “inputSchema”inputSchema: JsonObjectSchema;Defined in: core/src/tools.ts:43
Advertised to the model verbatim.
isConcurrencySafe?
Section titled “isConcurrencySafe?”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.
isReadOnly?
Section titled “isReadOnly?”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.
isTerminal?
Section titled “isTerminal?”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
needsApproval?
Section titled “needsApproval?”optional needsApproval?: boolean;Defined in: core/src/tools.ts:61
run: (input, ctx) => Promise<O>;Defined in: core/src/tools.ts:49
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
I |
ctx |
ToolContext |
Returns
Section titled “Returns”Promise<O>
summarize?
Section titled “summarize?”optional summarize?: (output) => string;Defined in: core/src/tools.ts:51
How the result reads back to the model. Defaults to JSON.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
output |
O |
Returns
Section titled “Returns”string
timeoutMs?
Section titled “timeoutMs?”optional timeoutMs?: number;Defined in: core/src/tools.ts:53
Default 60s. A tool with no ceiling can hang a whole run.
validate?
Section titled “validate?”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
raw |
unknown |
Returns
Section titled “Returns”I