Skip to main content

Module tools

Module tools 

Source
Expand description

Tool subsystem: trait definition, registry, and built-in tool implementations.

Every capability the agent can invoke (file I/O, git, shell, browser, etc.) is a struct that implements the Tool trait. Tools are collected into a ToolRegistry at agent startup — ToolRegistry::new() pre-registers all built-in tools, and additional tools (MCP server tools, FIM edit) can be added via ToolRegistry::register.

§Tool execution lifecycle

  1. The LLM emits a tool call with a name and JSON arguments.
  2. The agent resolves the name against ToolRegistry::get.
  3. Arguments are validated against the tool’s Tool::schema via validate_tool_arguments_schema (required-field and type checks).
  4. The safety checker gates execution (confirmation prompts, deny-lists).
  5. Tool::execute runs asynchronously and returns a JSON result.
  6. The result is fed back into the conversation for the next LLM turn.

Modules§

analyzer
browser
Browser Automation Tools
cargo
clarify
ask_user tool: lets the agent ask the human a single clarifying question when the task direction is genuinely ambiguous.
code_metrics
Code metrics analysis tool.
codemap
Code map tools for context-aware action planning.
computer
Computer control tools: mouse, keyboard, screen capture, window management.
container
Container Tools (Docker & Podman)
context
Context management tools — allow the model to inspect and optimize its context window.
file
fim
git
git_worktree
Git Worktree Isolation Tools
grep_search
Grep search tool - searches file contents using regex patterns.
http
HTTP request tool for web/API interactions
introspect
Code Introspection Tools for Selfware Evolution
knowledge
Knowledge Graph Tools
localize_issue
Localize issue tool — ranks candidate files/functions/tests for a given issue description using BM25-style keyword scoring, test-file proximity, and recent git change history.
lsp_tools
LSP tool wrappers for the agent’s tool registry.
net_policy
Shared network-policy helpers for URL / IP validation.
package
Package Manager Tools
page_controller
Page Controller — full Playwright-based browser automation tool.
patch_apply
process
Process Management Tools
prompt
Tool prompt trait for rich LLM-facing descriptions.
pty_shell
PTY-based interactive shell sessions.
screen_capture
Screen capture tool for general-purpose screenshot functionality.
search
shell_exec
Shell execution tool - runs shell commands with timeout and safety checks.
task_focus
Task-focused tool prioritization.
tool_search
Tool Search - Allows LLM to discover deferred tools on demand.
vision
Vision tools for analyzing and comparing images via vision-capable LLMs.

Structs§

PaginationInfo
Pagination metadata for truncated tool output.
ToolInfo
Metadata about a registered tool for search and categorization.
ToolRegistry
Name-keyed registry of available tools with support for deferred loading.

Constants§

CRITICAL_TOOLS
List of critical tools that are always available. These are the minimal tools needed for basic operations.

Traits§

Tool
A capability the agent can invoke during task execution.

Functions§

truncate_with_pagination
Truncate output at character boundaries, returning the page and pagination metadata.
validate_tool_arguments_schema
Validate tool arguments against the top-level JSON schema contract exposed to the model.