Skip to main content

is_interactive_tool

Function is_interactive_tool 

Source
pub fn is_interactive_tool(tool_name: &str) -> bool
Expand description

Returns true if the given tool name represents an interactive tool that requires user input.

Interactive tools pause execution and wait for user response:

  • AskUserQuestion: Prompts user with a question/options
  • EnterPlanMode: Enters planning mode, waits for user approval
  • ExitPlanMode: Presents plan for user approval

When these tools fire PreToolUse, the session should show the “needs input” indicator (blinking yellow !) rather than “running”.

§Arguments

  • tool_name - The name of the tool from a PreToolUse hook event

§Returns

true if the tool is interactive and needs user input, false otherwise. Returns false for empty or whitespace-only tool names.