Annotation Interface ToolArg
Tool method.
This annotation allows you to provide additional metadata about tool parameters, such as custom names and descriptions that will be included in the tool's JSON Schema definition.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDefault value for this parameter when not provided by the client.A human-readable description of the parameter.The name of the parameter as it appears in the tool's JSON Schema.booleanWhether this parameter is required. -
Field Summary
Fields
-
Field Details
-
ELEMENT_NAME
Constant value forname()indicating that the annotated element's name should be used as-is.- See Also:
-
-
Element Details
-
name
String nameThe name of the parameter as it appears in the tool's JSON Schema.Each argument to a tool must have a unique name.
By default, the parameter name from the method signature will be used (requires compilation with the
-parametersflag).- Returns:
- the parameter name
- Default:
"<<element name>>"
-
description
String descriptionA human-readable description of the parameter.This description will be included in the tool's JSON Schema to help clients understand what this parameter is for.
- Returns:
- the parameter description
- Default:
""
-
required
boolean requiredWhether this parameter is required.A parameter is not required if:
requiredis set tofalse, or- the parameter type is
Optional,OptionalDouble,OptionalIntorOptionalLong, or defaultValue()is set to a non-empty string
Otherwise, the parameter is required.
- Returns:
falseto make the parameter not required
- Default:
true
-
defaultValue
String defaultValueDefault value for this parameter when not provided by the client.The value should be provided as a string and will be converted to the appropriate type by the framework implementation. String, primitive types and their wrappers, and enums are typically converted automatically. For other parameter types, framework-specific converters may be required.
Setting a default value causes the parameter to not be required, regardless of the value of
required().- Returns:
- the default value as a string
- Default:
""
-