Function tools
Wrap any async function as a LangChainBaseTool:
@tool decorator directly - both work with LlmAgent.
AgentTool - sub-agents as tools
Wrap aBaseAgent so it can be called as a tool by a parent agent:
ctx.event_callback - each event carries a branch field (e.g. "ResearchAgent") for attribution.
AgentTool callbacks
Hook into the child agent’s event stream withbefore_agent_callback (intercept each event, optionally short-circuit) and after_agent_callback (run after completion):
Transfer tool - explicit agent handoff
Exit loop tool
Signal aLoopAgent to stop iterating:
CallContext
Inside a tool’s_arun(), use CallContext to read/write agent state:
LlmAgent automatically calls inject_context() on any tool that exposes it before each tool execution.
Filesystem tools
Sandboxed file operations restricted to a configurable workspace directory. All paths are validated to prevent escaping the workspace.
In Composer YAML, use the
filesystem builtin:
Shell tools
Sandboxed shell execution with timeout, output truncation, and command filtering.
Configuration via environment variables:
In Composer YAML, use the
shell builtin: