Package io.openliberty.mcp.annotations
Annotation Interface ToolArg
Annotates a parameter of a
Tool method.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default value is used when an MCP client does not provide an argument value.booleanAn argument is required by default unless no annotation value is set explicitly and the type of the annotated parameter isOptionalor the default value is set withdefaultValue(). -
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 name- Default:
- "<<element name>>"
-
description
String description- Default:
- ""
-
required
boolean requiredAn argument is required by default unless no annotation value is set explicitly and the type of the annotated parameter isOptionalor the default value is set withdefaultValue().- Default:
- true
-
defaultValue
String defaultValueThe default value is used when an MCP client does not provide an argument value.String, primitive types and corresponding wrappers, and enums are converted automatically. For any other parameter type a customDefaultValueConverteris needed.- See Also:
-
DefaultValueConverter
- Default:
- ""
-