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 value of the name attribute and false.

Example usage:


 @McpPrompt
 public String getWeather(@McpPromptParam(name = "city") String city) {
     // Method implementation...
 }
 
Author:
codeboyzhou
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the prompt parameter.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The description of the prompt parameter.
    boolean
    Whether the prompt parameter is required.
    The title of the prompt parameter.
  • Element Details

    • name

      String name
      The name of the prompt parameter.
      Returns:
      the name of the prompt parameter
    • title

      String title
      The title of the prompt parameter. Defaults to the value of the name attribute.
      Returns:
      the title of the prompt parameter
      Default:
      ""
    • description

      String description
      The description of the prompt parameter. Defaults to the value of the name attribute.
      Returns:
      the description of the prompt parameter
      Default:
      ""
    • required

      boolean required
      Whether the prompt parameter is required. Defaults to true.
      Returns:
      whether the prompt parameter is required
      Default:
      true