Class McpResourceCacheHints
java.lang.Object
org.springframework.ai.mcp.annotation.common.McpResourceCacheHints
Helpers for the
McpResource.ttlMs() and McpResource.cacheScope() cache
hints, which only the 2026-07-28 ("modern") MCP server can transmit.- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSet(McpResource annotation) Whether the annotation carries cache hints other than the defaults.static voidwarnIfIgnored(Method method, McpResource annotation) Logs a warning when a method served by a legacy (pre 2026-07-28) server declares cache hints, because the legacyresources/readresult has no field to carry them and they are silently dropped.
-
Method Details
-
isSet
Whether the annotation carries cache hints other than the defaults. -
warnIfIgnored
Logs a warning when a method served by a legacy (pre 2026-07-28) server declares cache hints, because the legacyresources/readresult has no field to carry them and they are silently dropped.
-