Annotation Interface McpJsonSchemaProperty


@Target(FIELD) @Retention(RUNTIME) public @interface McpJsonSchemaProperty
This annotation is used to define the property of a complex JSON schema type (such as custom Java data classes) for an MCP (Model Context Protocol) server.

By using this annotation, you can define custom JSON schema properties that are not natively supported by the MCP protocol. This allows you to use more complex data models in your MCP server.

Author:
codeboyzhou
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The description of the JSON schema property.
    The name of the JSON schema property.
    boolean
    Whether the JSON schema property is required.
  • Element Details

    • name

      String name
      The name of the JSON schema property. Defaults to the Java field name.
      Returns:
      the name of the JSON schema property
      Default:
      ""
    • description

      String description
      The description of the JSON schema property. Defaults to the value of the name attribute.
      Returns:
      the description of the JSON schema property
      Default:
      ""
    • required

      boolean required
      Whether the JSON schema property is required. Defaults to false.
      Returns:
      whether the JSON schema property is required
      Default:
      false