Interface ToolCallback

All Known Implementing Classes:
AsyncMcpToolCallback, FunctionToolCallback, MethodToolCallback, SyncMcpToolCallback

public interface ToolCallback
Represents a tool whose execution can be triggered by an AI model.
Since:
1.0.0
Author:
Thomas Vitale
  • Method Summary

    Modifier and Type
    Method
    Description
    call(String toolInput)
    Execute tool with the given input and return the result to send back to the AI model.
    default String
    call(String toolInput, ToolContext tooContext)
    Execute tool with the given input and context, and return the result to send back to the AI model.
    Definition used by the AI model to determine when and how to call the tool.
    default ToolMetadata
    Metadata providing additional information on how to handle the tool.
  • Method Details

    • getToolDefinition

      ToolDefinition getToolDefinition()
      Definition used by the AI model to determine when and how to call the tool.
    • getToolMetadata

      default ToolMetadata getToolMetadata()
      Metadata providing additional information on how to handle the tool.
    • call

      String call(String toolInput)
      Execute tool with the given input and return the result to send back to the AI model.
    • call

      default String call(String toolInput, @Nullable ToolContext tooContext)
      Execute tool with the given input and context, and return the result to send back to the AI model.