Interface PreToolUseHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PreToolUseHandler
Handler for pre-tool-use hooks.

This hook is called before a tool is executed, allowing you to:

  • Approve or deny tool execution
  • Modify tool arguments
  • Add additional context for the model
Since:
1.0.6
  • Method Details

    • handle

      Handles a pre-tool-use hook invocation.
      Parameters:
      input - the hook input containing tool name and arguments
      invocation - context information about the invocation
      Returns:
      a future that resolves with the hook output, or null to use defaults