Tool
Defined in: core/src/tools.ts:74
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
I |
unknown |
O |
unknown |
Properties
Section titled “Properties”description
Section titled “description”readonly description: string;Defined in: core/src/tools.ts:76
inputSchema
Section titled “inputSchema”readonly inputSchema: JsonObjectSchema;Defined in: core/src/tools.ts:77
isConcurrencySafe
Section titled “isConcurrencySafe”readonly isConcurrencySafe: boolean;Defined in: core/src/tools.ts:84
isReadOnly
Section titled “isReadOnly”readonly isReadOnly: boolean;Defined in: core/src/tools.ts:82
isTerminal
Section titled “isTerminal”readonly isTerminal: boolean;Defined in: core/src/tools.ts:85
readonly name: string;Defined in: core/src/tools.ts:75
needsApproval
Section titled “needsApproval”readonly needsApproval: boolean;Defined in: core/src/tools.ts:83
outputSchema?
Section titled “outputSchema?”readonly optional outputSchema?: Record<string, unknown>;Defined in: core/src/tools.ts:80
JSON Schema for generated result types. Not validated here or sent to providers;
zodTool’s output checks results and fills this in.
timeoutMs
Section titled “timeoutMs”readonly timeoutMs: number;Defined in: core/src/tools.ts:81
Methods
Section titled “Methods”accepts()
Section titled “accepts()”accepts(rawArgs): boolean;Defined in: core/src/tools.ts:92
Whether invoke would take these raw arguments, by the same validate, without running
the tool. Ask before opening an approval, so nobody is asked to approve a call that cannot
run: it would come back invalid_input after they said yes.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
rawArgs |
unknown |
Returns
Section titled “Returns”boolean
call()
Section titled “call()”call(input, ctx?): Promise<O>;Defined in: core/src/tools.ts:96
The typed path for internal callers: throws on failure.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
I |
ctx? |
ToolContext |
Returns
Section titled “Returns”Promise<O>
definition()
Section titled “definition()”definition(): ToolDefinition;Defined in: core/src/tools.ts:86
Returns
Section titled “Returns”invoke()
Section titled “invoke()”invoke(rawArgs, ctx?): Promise<ToolOutcome<O>>;Defined in: core/src/tools.ts:94
Validate, run, and report the outcome. Never throws except on abort.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
rawArgs |
unknown |
ctx? |
ToolContext |
Returns
Section titled “Returns”Promise<ToolOutcome<O>>