Skip to content

ExtendedToolProviderContext

ExtendedToolProviderContext<ToolProviderContext> = object & ToolProviderContextField<ToolProviderContext>

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

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. See notes/tool-sandboxing.md.

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).

agentId: string

memoryScope: string

optional workflow?: AgentWorkflowScope

ToolProviderContext = unknown