Skip to content
providerkit
GitHub

Tool

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

Type Parameter Default type
I unknown
O unknown
readonly description: string;

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


readonly inputSchema: JsonObjectSchema;

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


readonly isConcurrencySafe: boolean;

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


readonly isReadOnly: boolean;

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


readonly isTerminal: boolean;

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


readonly name: string;

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


readonly needsApproval: boolean;

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


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.


readonly timeoutMs: number;

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

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.

Parameter Type
rawArgs unknown

boolean


call(input, ctx?): Promise<O>;

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

The typed path for internal callers: throws on failure.

Parameter Type
input I
ctx? ToolContext

Promise<O>


definition(): ToolDefinition;

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

ToolDefinition


invoke(rawArgs, ctx?): Promise<ToolOutcome<O>>;

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

Validate, run, and report the outcome. Never throws except on abort.

Parameter Type
rawArgs unknown
ctx? ToolContext

Promise<ToolOutcome<O>>