Annotation Interface McpPromptParam


@Target(PARAMETER) @Retention(RUNTIME) public @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 literal string "Not specified" and false.

Example usage:


 @McpPrompt
 public String getWeather(@McpPromptParam(name = "city") String city) {
     // Method implementation...
 }
 
作者:
codeboyzhou
另请参阅:
  • 必需元素概要

    所需元素
    修饰符和类型
    必需的元素
    说明
    The name of the prompt parameter.
  • 可选元素概要

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

    • name

      String name
      The name of the prompt parameter.
      返回:
      the name of the prompt parameter
    • title

      String title
      The title of the prompt parameter. Defaults to the literal string "Not specified".
      返回:
      the title of the prompt parameter
      默认值:
      ""
    • description

      String description
      The description of the prompt parameter. Defaults to the literal string "Not specified".
      返回:
      the description of the prompt parameter
      默认值:
      ""
    • required

      boolean required
      Whether the prompt parameter is required. Defaults to false.
      返回:
      whether the prompt parameter is required
      默认值:
      false