Annotation Interface CopilotToolParam


Annotates a parameter of a CopilotTool-annotated method to provide metadata about the parameter that is sent to the model.

Example usage:

@CopilotTool("Search for issues")
public CompletableFuture<String> searchIssues(
                @CopilotToolParam(value = "Search query", required = true) String query,
                @CopilotToolParam(value = "Max results", required = false, defaultValue = "10") int limit) {
        // ...
}
Since:
1.0.2
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional default value when the argument is omitted.
    Parameter name override.
    boolean
    Whether this parameter is required.
    Optional explicit JSON Schema for this parameter as a JSON string literal.
    Parameter description (sent to the model).
  • Element Details

    • value

      String value
      Parameter description (sent to the model).
      Default:
      ""
    • name

      String name
      Parameter name override. Defaults to the actual parameter name.
      Default:
      ""
    • required

      boolean required
      Whether this parameter is required. Default true.
      Default:
      true
    • defaultValue

      String defaultValue
      Optional default value when the argument is omitted.
      Default:
      ""
    • schema

      String schema
      Optional explicit JSON Schema for this parameter as a JSON string literal. When non-empty, bypasses automatic schema generation from the parameter type. The value must be a valid JSON object string.

      Example:

      @CopilotTool("Schedule meeting")
      public String schedule(
                      @CopilotToolParam(value = "When to meet", schema = "{\"type\":\"string\",\"format\":\"date-time\"}") MyCustomDateTime when) {
              // ...
      }
      
      Default:
      ""