agentContext

The AIAgentContext of the agent run that is invoking this tool, or null if the metadata was not produced by the framework (for example when ToolBase.execute is called directly outside an agent run, such as from a unit test).

The framework injects the live agent context under AgentContextAwareTool.AgentContextKey after merging caller- and feature-supplied entries, so the value here is always the real context driving the current tool call. Tools that extend AgentContextAwareTool receive that context as a typed parameter; this extension is the ergonomic accessor for tools that extend ToolBase directly and want both the raw metadata bag and the context.