Class McpResourceCacheHints

java.lang.Object
org.springframework.ai.mcp.annotation.common.McpResourceCacheHints

public final class McpResourceCacheHints extends Object
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 Details

    • isSet

      public static boolean isSet(McpResource annotation)
      Whether the annotation carries cache hints other than the defaults.
    • warnIfIgnored

      public static void warnIfIgnored(Method method, McpResource annotation)
      Logs a warning when a method served by a legacy (pre 2026-07-28) server declares cache hints, because the legacy resources/read result has no field to carry them and they are silently dropped.