ToolExecutionContext
Interface: ToolExecutionContext
Defined in: src/core/tools.ts:33
Runtime context passed to tool.execute().
Properties
credential?
readonlyoptionalcredential?:Credential
Defined in: src/core/tools.ts:52
The credential resolved for this tool's declared needs (declare-and-push).
Present only when the tool declared a need and it resolved successfully.
credentials
readonlycredentials:CredentialProvider
Defined in: src/core/tools.ts:46
The bound credential provider — the PULL escape hatch for dynamic needs.
Always present: when none is attached it's a fail-closed provider that
THROWS, so it never silently no-ops via optional chaining. Prefer the
declarative needs + ctx.credential for the common case.
hasCredentials
readonlyhasCredentials:boolean
Defined in: src/core/tools.ts:49
True when a real provider is attached. Branch on this for intentional
degraded (no-credential) mode instead of relying on undefined.
iteration
readonlyiteration:number
Defined in: src/core/tools.ts:37
Current iteration number of the ReAct loop.
signal?
readonlyoptionalsignal?:AbortSignal
Defined in: src/core/tools.ts:39
Abort signal propagated from run({ env: { signal } }).
toolCallId
readonlytoolCallId:string
Defined in: src/core/tools.ts:35
Unique id of THIS tool invocation (matches stream.tool_start.toolCallId).
