Annotation Interface McpPrompt


@Target(METHOD) @Retention(RUNTIME) public @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...
 }
 
作者:
codeboyzhou
另请参阅:
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    The description of the prompt.
    The name of the prompt.
    The title of the prompt.
  • 元素详细资料

    • name

      String name
      The name of the prompt. Defaults to the name of the annotated method.
      返回:
      the name of the prompt
      默认值:
      ""
    • title

      String title
      The title of the prompt. Defaults to the value of the name attribute.
      返回:
      the title of the prompt
      默认值:
      ""
    • description

      String description
      The description of the prompt. Defaults to the value of the name attribute.
      返回:
      the description of the prompt
      默认值:
      ""