Annotation Interface McpResource


@Target({METHOD,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented public @interface McpResource
Marks a method as a MCP Resource.
Author:
Christian Tzolov
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional annotations for the client.
    A description of what this resource represents.
    The MIME type of this resource, if known.
    Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn’t present).
    Optional human-readable name of the prompt for display purposes.
    the URI of the resource.
  • Element Details

    • name

      String name
      Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn’t present).
      Default:
      ""
    • title

      String title
      Optional human-readable name of the prompt for display purposes.
      Default:
      ""
    • uri

      String uri
      the URI of the resource.
      Default:
      ""
    • description

      String description
      A description of what this resource represents. This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
      Default:
      ""
    • mimeType

      String mimeType
      The MIME type of this resource, if known.
      Default:
      "text/plain"
    • annotations

      Optional annotations for the client. Note: The default annotations value is ignored.
      Default:
      @org.springaicommunity.mcp.annotation.McpResource.McpAnnotations(audience={USER}, lastModified="", priority=0.5)