Class ToolUtils

java.lang.Object
org.springframework.ai.tool.support.ToolUtils

public final class ToolUtils extends Object
Miscellaneous tool utility methods. Mainly for internal use within the framework.
Author:
Thomas Vitale
  • Method Details

    • getToolName

      public static String getToolName(Method method)
    • getToolDescriptionFromName

      public static String getToolDescriptionFromName(String toolName)
    • getToolDescription

      public static String getToolDescription(Method method)
    • getToolReturnDirect

      public static boolean getToolReturnDirect(Method method)
    • getToolRequiresConfirmation

      public static boolean getToolRequiresConfirmation(Method method)
      Whether calls of the @Tool method need a person's confirmation before they run.
      Parameters:
      method - the tool method
      Returns:
      true when the method's @Tool sets requiresConfirmation
      Since:
      2.1.0
    • getToolCallResultConverter

      public static ToolCallResultConverter getToolCallResultConverter(Method method)
    • getDuplicateToolNames

      public static List<String> getDuplicateToolNames(List<ToolCallback> toolCallbacks)
    • getDuplicateToolNames

      public static List<String> getDuplicateToolNames(ToolCallback... toolCallbacks)