Annotation Interface McpResource
A URI containing RFC 6570 Level 1 variables is a template registration;
each variable is bound to exactly one McpResourceUriParameter
method parameter. An exact URI contributes a descriptor to the static
resources/list fallback. A URI template is advertised separately by
resources/templates/list.
Level 1 simple variables cannot consume a raw slash: file:///{path}
matches file:///src%2Fmain.rs, yielding src/main.rs, but not
file:///src/main.rs. Reserved expansion ({+path}), explode
and prefix modifiers are unsupported. Captured values are UTF-8
percent-decoded exactly once.
- Author:
- Mark Allen
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe resource name published to MCP clients.The absolute resource URI or RFC 6570 Level 1 URI template. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe fixed cache scope for reads through this registration.longThe default cache time to live for reads through this registration.The optional human-readable resource description.Client requests this resource-read operation may emit during multi-round-trip handling.The optional resource MIME type.The request-state contract for this resource-read operation.longThe raw size of an exact resource in bytes.The optional human-readable resource title.
-
Element Details
-
protocolVersions
- Returns:
- the required exact MCP revisions on which this resource is available
-
uri
-
name
-
title
-
description
The optional human-readable resource description.- Returns:
- description, or an empty string if none is configured
- Default:
""
-
mimeType
-
sizeInBytes
long sizeInBytesThe raw size of an exact resource in bytes.URI templates cannot declare a size because their concrete resources may differ. The default
-1means that no size is published.- Returns:
- nonnegative exact-resource size, or
-1when absent
- Default:
-1L
-
cacheTimeToLiveInMilliseconds
The default cache time to live for reads through this registration.- Returns:
- nonnegative whole-millisecond time to live
- Default:
0L
-
cacheScope
The fixed cache scope for reads through this registration.- Returns:
- cache scope
- Default:
PRIVATE
-
mayRequestInput
Client requests this resource-read operation may emit during multi-round-trip handling.A nonempty declaration requires the method to return
McpOperationResultor a subtype.- Returns:
- input-request declarations
- Default:
{}
-
requestStateMode
The request-state contract for this resource-read operation.A mode other than
McpRequestStateMode.NONErequires the method to returnMcpOperationResultor a subtype.- Returns:
- request-state mode
- Default:
NONE
-