Annotation Interface McpResource
Marks a method as a MCP Resource.
- Author:
- Christian Tzolov, Alexandros Pappas, Vadzim Shurmialiou, Craig Walls
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionOptional annotations for the client.A description of what this resource represents.Class<? extends MetaProvider> Optional meta provider class that supplies data for "_meta" field for this resource declaration.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 nameIntended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn’t present).- Default:
""
-
title
String titleOptional human-readable name of the prompt for display purposes.- Default:
""
-
uri
String urithe URI of the resource.- Default:
""
-
description
String descriptionA 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 mimeTypeThe MIME type of this resource, if known.- Default:
"text/plain"
-
annotations
McpResource.McpAnnotations annotationsOptional annotations for the client. Note: The default annotations value is ignored.- Default:
@org.springframework.ai.mcp.annotation.McpResource.McpAnnotations(audience={USER}, lastModified="", priority=0.5)
-
metaProvider
Class<? extends MetaProvider> metaProviderOptional meta provider class that supplies data for "_meta" field for this resource declaration. Defaults toDefaultMetaProviderimplementation.- Returns:
- the meta provider class to use for this resource
- Default:
org.springframework.ai.mcp.annotation.context.DefaultMetaProvider.class
-