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...
}
- 作者:
- codeboyzhou
- 另请参阅:
-
必需元素概要
所需元素 -
可选元素概要
可选元素修饰符和类型可选元素说明The description of the prompt parameter.booleanWhether the prompt parameter is required.The title of the prompt parameter.
-
元素详细资料
-
name
String nameThe name of the prompt parameter.- 返回:
- the name of the prompt parameter
-
-
-
title
String titleThe title of the prompt parameter. Defaults to the value of thenameattribute.- 返回:
- the title of the prompt parameter
- 默认值:
- ""
-
description
String descriptionThe description of the prompt parameter. Defaults to the value of thenameattribute.- 返回:
- the description of the prompt parameter
- 默认值:
- ""
-
required
boolean requiredWhether the prompt parameter is required. Defaults tofalse.- 返回:
- whether the prompt parameter is required
- 默认值:
- false
-