ToolContext
Context passed to tool executions.
This subclass is kept for backward compatibility. Prefer Context in new code.
A tool context is not a node activation, so the node-only members inherited from Context (such as Context.output and Context.routes) throw IllegalStateException here.
Constructors
Properties
The event actions for the current context, holding state deltas and control-flow signals to be attached to emitted events.
The ArtifactService instance.
1-based attempt number, which a retry increments. 1 off-graph.
Per-invocation scratch data; see ContextFrameworkData.callbackContextData.
The readonly invocation context.
The same EventActions instance as actions, under the property name used by callbacks.
The author stamped on events this node emits.
The unique ID of the function call.
Whether an output has been produced, by this node or by a useAsOutput delegate.
Interrupt IDs this node activation is waiting on.
The unique ID of this invocation.
The MemoryService instance.
The node this context is an activation of.
This activation's path: name@runId segments joined by /, rooted at the outermost node.
The context of the node that scheduled this one, or null at the root or off-graph.
Answers to this node's interrupts, keyed by interrupt id. Empty off-graph.
The routes this node selected, read by the scheduler to pick the outgoing edges.
This activation's id within its node, counting from "1". It is a string because it forms the name@runId segment of a node path. "1" off-graph.
The user's answer to the current tool call's, or node run's, confirmation request.
The user content that this invocation is processing.
Functions
Triggers memory generation for the current session.
Requests the current LLM agent to stop after the current step completes.
Lists the filenames of the artifacts attached to the current session. Returns an empty list if no artifact service is configured.
Loads an artifact attached to the current session by name. Returns null if no artifact service is configured or the artifact is not found.
Requests confirmation for the current tool call. Only a tool call has a functionCallId, so this can only be called in a tool context.
Sets this node's output to value's JSON form under T's serializer, or to a Content as it is, so a successor typed T reads it back, live and after a session reload. Can be called at most once per activation, and drops value if runNode already delegated output to a child with useAsOutput. Use it from a custom node for a typed value, since emitting that value directly fails the node.
Records a state change in actions stateDelta (copy-on-write) so it appears in state and flushes on the next event. State.TEMP_PREFIX keys are never stored; keys without an app:, user: or temp: prefix must match the node's state schema, if any, and the checked value is stored.