Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

ClientTool.md

117 lines2.7 KB

Interface: ClientTool<TInput, TOutput, TName>

Defined in: activities/chat/tools/tool-definition.ts:23

Marker type for client-side tools

Type Parameters

TInput

TInput extends SchemaInput = z.ZodType

TOutput

TOutput extends SchemaInput = z.ZodType

TName

TName extends string = string

Properties

__toolSide

__toolSide: "client";

Defined in: activities/chat/tools/tool-definition.ts:28


description

description: string;

Defined in: activities/chat/tools/tool-definition.ts:30


execute()?

optional execute: (args) => 
  | InferSchemaType<TOutput>
| Promise<InferSchemaType<TOutput>>;

Defined in: activities/chat/tools/tool-definition.ts:35

Parameters

args

InferSchemaType<TInput>

Returns

| InferSchemaType<TOutput> | Promise<InferSchemaType<TOutput>>


inputSchema?

optional inputSchema: TInput;

Defined in: activities/chat/tools/tool-definition.ts:31


metadata?

optional metadata: Record<string, any>;

Defined in: activities/chat/tools/tool-definition.ts:34


name

name: TName;

Defined in: activities/chat/tools/tool-definition.ts:29


needsApproval?

optional needsApproval: boolean;

Defined in: activities/chat/tools/tool-definition.ts:33


outputSchema?

optional outputSchema: TOutput;

Defined in: activities/chat/tools/tool-definition.ts:32