Annotation Interface Tool


Marks a method as a tool in Spring AI.
Since:
1.0.0
Author:
Thomas Vitale
  • Element Details

    • name

      String name
      The name of the tool. If not provided, the method name will be used.
      Default:
      ""
    • description

      String description
      The description of the tool. If not provided, the method name will be used.
      Default:
      ""
    • returnDirect

      boolean returnDirect
      Whether the tool result should be returned directly or passed back to the model.
      Default:
      false
    • resultConverter

      Class<? extends ToolCallResultConverter> resultConverter
      The class to use to convert the tool call result to a String.
      Default:
      org.springframework.ai.tool.execution.DefaultToolCallResultConverter.class