Skip to content

ExtendedToolProviderContext

ExtendedToolProviderContext<ToolProviderContext> = object & ToolProviderContextField<ToolProviderContext>

Defined in: packages/core/src/tools/provider.ts:40

Passed to a ToolProvider when resolving tools for a call. Generic so createToolProvider (and AgentDefinition.tools directly) can narrow toolProviderContext for an author, but the version actually stored — via AgentRunInput.tools’s bare ToolProvider<Tools> — stays at the default ToolProviderContext = unknown. Not for widening (registries widen to AnyAgent, whose any params tolerate a parameterized copy just fine); it’s because a per-call tools override is deliberately independent of the agent’s own ToolProviderContext — a caller can pass any provider here regardless of what the agent it’s overriding declares.

This is always the raw value a caller passed to AgentRunInput.toolProviderContext — the framework never parses or validates it. A provider that wants Zod validation/defaults calls .parse() itself as the first line of getTools (see createToolProvider’s doc comment for the recipe).

agentCallId is the id of this agent.run / agent.stream episode (not the conversation). projectRoot is the ADL project directory when the runtime was loaded via LoadedAdlProject (or set explicitly on createAdlRuntime); omitted for bare runtimes that never attached one.

agentCallId: string

Stable id for this agent episode — one per agent.run / agent.stream call.

agentId: string

memoryScope: string

optional projectRoot?: string

Absolute ADL project root when known; see RuntimeServices.projectRoot.

recordEffect: EffectEventRecorder["emit"]

Persist effect_intent / effect_settled for gated tools. The agent runner always passes its import(”../runtime/run-recorder”).RunRecorder.emit; a test that builds this context by hand passes a no-op (silentRecordEffect in @agent-dev-lab/tools).

optional workflow?: AgentWorkflowScope

ToolProviderContext = unknown