createToolFromAgent
createToolFromAgent<
ToolProviderContext,Tools,TOutput,TToolInput>(runtime,agent,options):Tool<TToolInput,TOutput>
Defined in: packages/core/src/tools/from-agent.ts:43
Expose an agent turn as an AI SDK tool. Prefer AdlRuntime.createToolFromAgent.
Works outside a workflow: meta.ctx is set only when the tool runs inside a
workflow body or step. Standalone calls allocate their own agent episode.
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = undefined
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
TToolInput
Section titled “TToolInput”TToolInput = DefaultToolInput
Parameters
Section titled “Parameters”runtime
Section titled “runtime”Agent<ToolProviderContext, Tools, TOutput>
options
Section titled “options”CreateToolFromAgentOptions<ToolProviderContext, TToolInput>
Returns
Section titled “Returns”Tool<TToolInput, TOutput>