Annotation Interface McpPrompt
This annotation is used to mark a method as an MCP (Model Context Protocol) prompt method.
The prompt's name defaults to the name of the annotated method. Prompt 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:
@McpPrompt
public String getWeather(String city) {
// Method implementation...
}
- Author:
- codeboyzhou
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameThe name of the prompt. Defaults to the name of the annotated method.- Returns:
- the name of the prompt
- Default:
- ""
-
title
String titleThe title of the prompt. Defaults to the value of thenameattribute.- Returns:
- the title of the prompt
- Default:
- ""
-
description
String descriptionThe description of the prompt. Defaults to the value of thenameattribute.- Returns:
- the description of the prompt
- Default:
- ""
-