Annotation Interface McpToolParam
This annotation is used to mark a method parameter as an MCP (Model Context Protocol) tool
parameter.
The parameter's name must be specified explicitly. Parameter metadata such as description and
required status can be specified via the corresponding attributes. If omitted, these metadata
fields will default to the literal string "Not specified" and false.
Example usage:
@McpTool
public String getWeather(@McpToolParam(name = "city") String city) {
// Method implementation...
}
- 作者:
- codeboyzhou
-
必需元素概要
所需元素 -
可选元素概要
可选元素修饰符和类型可选元素说明The description of the tool parameter.booleanWhether the tool parameter is required.
-
元素详细资料
-
name
String nameThe name of the tool parameter.- 返回:
- the name of the tool parameter
-
-
-
description
String descriptionThe description of the tool parameter. Defaults to the literal string "Not specified".- 返回:
- the description of the tool parameter
- 默认值:
- ""
-
required
boolean requiredWhether the tool parameter is required. Defaults tofalse.- 返回:
- whether the tool parameter is required
- 默认值:
- false
-