Interface ToolCallAction

All Known Implementing Classes:
ToolCallAction.Allow, ToolCallAction.Block, ToolCallAction.Fallback, ToolCallAction.Guide

Represents the outcome of a ToolCallFilter evaluation.

Four possible actions:

  • allow() — proceed with tool execution
  • block() — reject the tool call
  • guide(String) — don't execute yet, feed guidance back to the agent so it can self-correct and retry
  • fallback(String) — suggest an alternative tool or approach

Inspired by Strands Agents' SteeringHandler pattern.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Allow the tool call to proceed as-is.
    static final record 
    Block the tool call entirely.
    static final record 
    Don't execute; suggest an alternative tool or approach.
    static final record 
    Don't execute; provide feedback for the agent to self-correct.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an action that allows the tool call to proceed.
    Creates an action that blocks the tool call.
    fallback(String suggestion)
    Creates an action that suggests an alternative tool or approach.
    guide(String feedback)
    Creates an action that provides guidance to the agent for self-correction.
    default boolean
    Whether the tool call should proceed immediately.
  • Method Details

    • shouldProceed

      default boolean shouldProceed()
      Whether the tool call should proceed immediately.
    • allow

      static ToolCallAction allow()
      Creates an action that allows the tool call to proceed.
    • block

      static ToolCallAction block()
      Creates an action that blocks the tool call.
    • guide

      static ToolCallAction guide(String feedback)
      Creates an action that provides guidance to the agent for self-correction. The tool call is not executed; instead the feedback is injected into the agent's context so it can adjust parameters and retry.
      Parameters:
      feedback - correction guidance for the agent
    • fallback

      static ToolCallAction fallback(String suggestion)
      Creates an action that suggests an alternative tool or approach. The original tool call is not executed.
      Parameters:
      suggestion - alternative tool name or approach description