Agent Tools
term2 exposes a controlled set of tools to the agent, gated by the active profile and sandbox policies.
Filesystem Tools
Section titled “Filesystem Tools”read_file: Reads file contents with support for line-number ranges (offsetandlimit) and size bounds.apply_patch: Applies unified patches to files with preview and self-healing syntax recovery.search_replace: Performs precise contiguous block replacements within a file.create_file: Creates a new file in the workspace (or overwrites an existing file if explicitly approved).glob: Finds files and directories using glob patterns (leveragingfdwhen installed).grep: Performs regex or literal text searches across files (leveragingripgrepwhen installed).read_code_outline: Generates high-level symbol outlines (classes, functions, interfaces) for rapid file comprehension.code_context_search: Searches code symbols and definitions across the codebase.
Shell Execution
Section titled “Shell Execution”shell: Executes shell commands within the active sandbox policy. Commands that read or write outside approved boundaries prompt for explicit confirmation.- Background Shell Jobs: Long-running commands can run detached in the background:
get_shell_job: Check running state, exit codes, and output byte counts.monitor_shell_job: Stream or fetch buffered output logs.cancel_shell_job: Terminate background jobs gracefully or forcefully.cancel_shell_monitor: Stop an output watch.
Sandboxed JavaScript Execution (run_code)
Section titled “Sandboxed JavaScript Execution (run_code)”run_code: Executes JavaScript in a sandboxed V8 context directly inside the Node.js process.- Nested Tool Invocation: Inside a
run_codescript, the agent can call other tools programmatically viaawait tools.<toolName>(args). - Tool Approvals in Code: Nested read-only tool calls run automatically, while actions requiring approval prompt the user before continuing.
- Script Isolation: Scripts execute in an isolated environment without access to process globals or host credentials.
- JSON Inputs: Pass structured data separately from the script source with the
inputsparameter; values are available through the script’sinputsbinding. - Result Contracts: Scriptable tools expose a declarable return shape through
describe, so a workflow can inspect the expected result before calling a tool. - Nested Trace: Tool calls made by a script are shown in the conversation and remain subject to the active approval policy.
User & Advisory Tools
Section titled “User & Advisory Tools”ask_user: Asks clarifying questions to the user with an interactive prompt and selectable choices.ask_mentor: Consults the higher-tier mentor model for architectural guidance or code review.activate_skill: Loads specialized instruction sets and workflows for domain-specific tasks.
Web Research
Section titled “Web Research”web_search: Search the web through the configured Tavily or Exa provider.web_fetch: Fetch and extract content from a URL.