Skip to main content

Module tools

Module tools 

Source
Expand description

Tools the agent can call.

A Tool is a named capability with a JSON-Schema input and an async execute. The ToolRegistry holds the set offered to a model; built-ins cover file read/write/edit, directory listing, glob, content search, and shell execution. Every tool can be disabled or re-described per crate::Config, so the capability surface is entirely yours to shape.

Structs§

ApplyPatchTool
Apply a Codex-style apply_patch envelope — Codex’s primary edit mechanism, richer than edit_file’s single string replace. Supports Add File, Delete File, and Update File (with -/+/context hunks and an optional *** Move to: rename) in one atomic-ish call.
BashTool
Run a shell command via sh -c.
EditFileTool
Replace an exact substring in a file.
GlobTool
Match files by glob pattern.
ListDirTool
List directory entries.
PersistentShellTool
A long-lived shell whose state (working directory, environment variables, shell functions) persists across calls — unlike the one-shot BashTool. Also supports write_stdin to feed raw input to the shell, for driving interactive programs. This is the analog of Codex’s persistent exec session.
ReadFileTool
Read a UTF-8 text file.
SearchTool
Regex search file contents (respecting .gitignore).
ToolContext
Ambient context passed to every tool invocation.
ToolRegistry
An ordered set of tools offered to the model.
UpdatePlanTool
A simple plan / task tracker. The model calls it to record or update a checklist of steps (the analog of Codex update_plan / Claude’s plan mode). The plan is held in the tool so it persists across calls within a session.
WriteFileTool
Create or overwrite a file.

Enums§

SandboxPolicy
Filesystem confinement applied to write-capable tools — the analog of Codex’s read-only / workspace-write / danger-full-access sandbox modes.

Traits§

Tool
A callable capability.