Skip to main content

Type Alias: InferToolParams<T>

InferToolParams<T> = T extends object ? InferOutput<S> : T extends object ? P : never

Defined in: packages/core/src/type-utils.ts:167

Infer the parameter type from a tool definition

Type Parameters

T

T

Example

const tool = defineZodTool({
schema: z.object({ x: z.number() }),
function: (params) => params.x * 2
});
type Params = InferToolParams<typeof tool>; // { x: number }