pub enum Tool {
Show 16 variants
AskUserQuestion,
EnterPlanMode,
ExitPlanMode,
Bash,
Read,
Write,
Edit,
Grep,
Glob,
Task,
WebSearch,
WebFetch,
TodoWrite,
NotebookEdit,
NotebookRead,
Other(String),
}Expand description
A tool an agent can invoke.
Variants are limited to tools the daemon special-cases (interactive
permission-gated tools, common tools we render with a friendlier
label). Everything else lives in Other(String) and round-trips
losslessly.
Variants§
AskUserQuestion
AskUserQuestion — pauses and prompts the user.
EnterPlanMode
EnterPlanMode — pauses for plan approval.
ExitPlanMode
ExitPlanMode — pauses presenting the plan.
Bash
Read
Write
Edit
Grep
Glob
Task
WebSearch
WebFetch
TodoWrite
NotebookEdit
NotebookRead
Other(String)
Any other tool name — MCP tools, vendor-specific tools, future well-known tools we haven’t promoted to a variant yet.
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn is_interactive(&self) -> bool
pub fn is_interactive(&self) -> bool
True for tools whose PreToolUse event means the session is
awaiting user input rather than running.
Adapter authors: this classification is Claude-driven today (pi
has no equivalent event — its permission gating is extension-
mediated and surfaces via NeedsInputReason::PermissionGate).
If a vendor’s tool genuinely blocks waiting on user input,
promote it to a variant rather than relying on string matching.