Annotation Interface McpTool
This annotation is used to mark a method as an MCP (Model Context Protocol) tool method.
The tool's name defaults to the name of the annotated method. Tool metadata such as title and
description can be specified via the corresponding attributes. If omitted, these metadata fields
will default to the value of the name attribute.
Example usage:
@McpTool
public String getWeather(String city) {
// Method implementation...
}
- 作者:
- codeboyzhou
- 另请参阅:
-
可选元素概要
可选元素
-
元素详细资料
-
name
String nameThe name of the tool. Defaults to the name of the annotated method.- 返回:
- the name of the tool
- 默认值:
- ""
-
title
String titleThe title of the tool. Defaults to the value of thenameattribute.- 返回:
- the title of the tool
- 默认值:
- ""
-
description
String descriptionThe description of the tool. Defaults to the value of thenameattribute.- 返回:
- the description of the tool
- 默认值:
- ""
-