Annotation Type Tool


@Retention(RUNTIME) @Target(METHOD) public @interface Tool
Annotation to mark a method as a tool function within the AI provider framework.

Methods annotated with @Tool are recognized as callable tools, typically exposed for dynamic invocation or registration in tool catalogs. The annotation provides metadata such as the tool's name and description.

  • name: Optional tool name. If not specified, NOT_DEFINED is used as a placeholder.
  • description: Required description of the tool's purpose and functionality.

The annotation is retained at runtime and applicable to methods only.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Description of the tool's purpose and functionality.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional tool name.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Placeholder value indicating that the tool name is not defined.
  • Field Details

    • NOT_DEFINED

      static final String NOT_DEFINED
      Placeholder value indicating that the tool name is not defined.
      See Also:
  • Element Details

    • name

      String name
      Optional tool name. If not specified, NOT_DEFINED is used.
      Returns:
      the name of the tool, or NOT_DEFINED if not set
      Default:
      "___NOT_DEFINED___"
    • description

      String description
      Description of the tool's purpose and functionality.
      Returns:
      the tool description