Function: widenTool()
Makaio Framework / tools-core / widenTool
Function: widenTool()
Section titled “Function: widenTool()”widenTool<
TInput,TOutput>(tool):AnyToolDefinition
Defined in: ../../../tools/core/src/widen-tool.ts:13
Widens a strongly-typed tool definition for use in heterogeneous collections.
Tool definitions are invariant in their input/output generic parameters. This
helper provides a single canonical widening point for defineToolset({ tools: [...] })
call sites that need AnyToolDefinition.
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
TOutput
Section titled “TOutput”TOutput extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
Parameters
Section titled “Parameters”ToolDefinition<TInput, TOutput>
Strongly-typed tool definition
Returns
Section titled “Returns”The same tool typed as AnyToolDefinition