AgentContext
Context available during the agent onion hook.
Provides access to the agent definition and tool registration. This is the shallowest context — all deeper contexts inherit from it.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”agent:
object
Agent definition: name, model, instructions.
instructions
Section titled “instructions”instructions:
string
model:
string
name:
string
config
Section titled “config”config:
Record<string,unknown>
Middleware-specific configuration from the agent definition.
Methods
Section titled “Methods”registerTool()
Section titled “registerTool()”registerTool(
tool):void
Register a tool on the agent. Call in the agent hook before next().
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void