Skip to main content

Function: typedToolCall()

typedToolCall<TSchema, TReturn>(segment, toolDef, options?): TypedToolCallData<InferOutput<TSchema>, TReturn>

Defined in: packages/core/src/segments/typed-tool-call.ts:22

A segment's data typed by its tool definition. The types are asserted, not checked: pass validate to parse the arguments with the input schema (which throws on a mismatch); the result is never checked.

Type Parameters​

TSchema​

TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

TReturn​

TReturn

Parameters​

segment​

ToolCallSegment

toolDef​

ZodToolDefinition<TSchema, TReturn>

options?​

validate?​

boolean

Returns​

TypedToolCallData<InferOutput<TSchema>, TReturn>