Package org.mcpjava.server.prompts
Annotation Interface PromptArg
Configures a parameter of a
Prompt method.
This annotation allows you to provide metadata about prompt arguments, such as names, descriptions, and whether they are required.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDefault value for this argument when not provided.A human-readable description of the argument.The name of the argument.booleanWhether this parameter is required.A human-readable title for the argument. -
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 argument.Each argument to a prompt must have a unique name.
By default, the parameter name from the method signature will be used (requires compilation with the
-parametersflag).- Returns:
- the argument name
- Default:
"<<element name>>"
-
title
String titleA human-readable title for the argument.This is a short, user-friendly display name for the argument.
- Returns:
- the argument title
- Default:
""
-
description
String descriptionA human-readable description of the argument.- Returns:
- the argument 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 argument when not provided.The value should be provided as a string and will be converted to the appropriate type by the framework implementation.
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:
""
-