Annotation Interface McpPromptParam
This annotation is used to mark a method parameter as an MCP (Model Context Protocol) prompt
parameter.
The parameter's name must be specified explicitly. Parameter metadata such as title,
description, and required can be specified via the corresponding attributes. If omitted, these
metadata fields will default to the value of the name attribute and false.
Example usage:
@McpPrompt
public String getWeather(@McpPromptParam(name = "city") String city) {
// Method implementation...
}
- Author:
- codeboyzhou
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe description of the prompt parameter.booleanWhether the prompt parameter is required.The title of the prompt parameter.
-
Element Details
-
name
String nameThe name of the prompt parameter.- Returns:
- the name of the prompt parameter
-
-
-
title
String titleThe title of the prompt parameter. Defaults to the value of thenameattribute.- Returns:
- the title of the prompt parameter
- Default:
- ""
-
description
String descriptionThe description of the prompt parameter. Defaults to the value of thenameattribute.- Returns:
- the description of the prompt parameter
- Default:
- ""
-
required
boolean requiredWhether the prompt parameter is required. Defaults totrue.- Returns:
- whether the prompt parameter is required
- Default:
- true
-