Skip to main content

Module tools

Module tools 

Source
Expand description

Tool abstraction: any side effect the model can request.

Tools are orthogonal to the agent and to each other. To add a capability you implement Tool and register it; no other file changes.

Re-exports§

pub use a2a::A2aCallTool;
pub use a2a::A2aCardTool;
pub use a2a::A2aTaskCheckTool;
pub use apply_patch::ApplyPatch;
pub use checkpoint::build_checkpoint_tools;
pub use checkpoint::CheckpointDiff;
pub use checkpoint::CheckpointList;
pub use checkpoint::CheckpointToolCtx;
pub use episodic_recall::episodic_recall_summary;
pub use episodic_recall::EpisodicRecall;
pub use estimate_tokens::EstimateTokens;
pub use facts::facts_path;
pub use facts::facts_summary;
pub use facts::load_facts;
pub use facts::search_facts;
pub use facts::Fact;
pub use facts::FactStore;
pub use facts::ForgetFact;
pub use facts::RecallFact;
pub use facts::RememberFact;
pub use facts::ScoredFact;
pub use facts::UpdateFact;
pub use fs::ListDir;
pub use fs::ReadFile;
pub use fs::WriteFile;
pub use load_skill::LoadSkill;
pub use memory::load_scratchpad;
pub use memory::scratchpad_path;
pub use memory::scratchpad_summary;
pub use memory::Scratchpad;
pub use memory::ScratchpadDelete;
pub use memory::ScratchpadGet;
pub use memory::ScratchpadList;
pub use memory::WorkingMemoryTool;
pub use memory::Forget;
pub use memory::Recall;
pub use memory::Remember;
pub use plan_mode::EnterPlanModeTool;
pub use plan_mode::ExitPlanModeTool;
pub use plan_mode::PlanApprovalGate;
pub use plan_mode::PlanApprovalResult;
pub use plan_mode::PlanModeRequestGate;
pub use plan_mode::PlanModeRequestResult;
pub use plan_mode::RequestPlanModeTool;
pub use policy_sandbox::FsPolicy;
pub use policy_sandbox::PolicyConfig;
pub use policy_sandbox::ShellPolicy;
pub use run_background::BackgroundJobManager;
pub use run_background::CheckBackground;
pub use run_background::Job;
pub use run_background::JobState;
pub use run_background::RunBackground;
pub use run_skill_script::RunSkillScript;
pub use schedule_wakeup::ScheduleWakeup;
pub use schedule_wakeup::WakeupRequest;
pub use schedule_wakeup::WakeupSlot;
pub use search::SearchFiles;
pub use send_message::SendMessageTool;
pub use send_message::WorkerMailbox;
pub use send_message::WorkerRegistry;
pub use shell::RunShell;
pub use spawn_worker::SpawnWorkerTool;
pub use spawn_worker::WorkerType;
pub use str_replace::StrReplaceTool;
pub use sub_agent::SubAgent;
pub use team_manage::TeamAddRole;
pub use team_manage::TeamListRoles;
pub use team_manage::TeamRemoveRole;
pub use todo::TodoItem;
pub use todo::TodoStatus;
pub use todo::TodoWriteTool;
pub use transport::DirEntry;
pub use transport::ExecResult;
pub use transport::LocalTransport;
pub use transport::ReadResult;
pub use transport::ToolTransport;
pub use web_fetch::WebFetch;

Modules§

a2a
a2a_call tool — invoke a remote A2A (Agent2Agent v1.0) agent.
apply_patch
apply_patch: apply a structured multi-file patch atomically.
checkpoint
Read-only agent tools that surface the session’s checkpoint chain.
episodic_recall
Episodic recall tool — search past session transcripts.
estimate_tokens
Token estimation tool: estimate token count for text or file contents.
facts
Memory Layer 2 — Semantic facts with search.
fs
Filesystem tools: read_file, write_file, list_dir.
load_skill
Tool to load a skill’s content by name.
memory
Persistent memory tools: remember, recall, forget.
plan_mode
enter_plan_mode / exit_plan_mode tools — agent-driven read-only planning.
policy_sandbox
L1 policy-based sandbox wrapper for tools.
run_background
run_background and check_background: spawn long-running commands asynchronously and poll their status later.
run_skill_script
Tool to run a script from a skill’s scripts/ directory.
schedule_wakeup
schedule_wakeup tool — lets the agent request a timed re-invocation.
search
search_files: substring/regex search across workspace files.
send_message
send_message tool — bidirectional coordinator ↔ worker messaging.
shell
run_shell: execute a command in the workspace.
spawn_worker
spawn_worker tool: first-class coordinator-pattern delegation.
str_replace
str_replace: edit a file by replacing an exact string.
sub_agent
Sub-agent tool: spawn a fresh agent loop with a restricted tool subset.
team_manage
Dynamic team management tools: team_add_role, team_remove_role, team_list_roles.
todo
todo_write tool — agent task-list management.
transport
Transport abstraction: decouple tools from direct filesystem/shell access.
web_fetch
web_fetch: HTTP GET tool for fetching web content.

Structs§

AuditMeta
Per-call audit record returned by ToolRegistry::invoke_with_audit and stored in crate::session::TranscriptEntry::audit.
ToolDispatch
Return value of ToolRegistry::invoke_with_audit: the tool result and its accompanying audit record.
ToolRegistry
TouchedFiles
Observer that records files touched by structured filesystem tools during a single agent turn. Owned by AgentRuntime and reset at every turn boundary; passed by Arc<Mutex<...>> to the ToolRegistry so tool dispatch can record path arguments.

Enums§

ExitStatus
Outcome of a single tool invocation, as recorded in AuditMeta.
ToolSideEffect
Classification of a tool’s observable side-effects on state outside the agent process. Used by orphan detection and safe-replay (g154) to decide how aggressively to retry or skip an unfinished tool call.

Constants§

AUDIT_ERR_MAX_BYTES
Maximum length of the persisted error message in ExitStatus::Err. Anything longer is UTF-8 char-boundary clipped and truncated is set.

Traits§

PermissionHook
Goal-161: runtime permission hook. Implement this trait to intercept every tool invocation before it runs.
Tool

Functions§

args_preview_for_permission
Build a short human-readable preview of tool arguments for the permission dialog. Extracts up to 80 characters.
build_standard_tools
Build the standard tool registry for an agent rooted at workspace.