You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document caching behavior and warn on non-conformant draft cacheable results
Follow-up to the SEP-2549 caching hints work in PR #1623, addressing two of
its tracked follow-up issues:
Fixes#1645: Tighten the doc comments on the auto-paginating list overloads
(tools/prompts/resources/resource-templates) to state plainly that the SDK
performs no internal caching of listing results, and that any caching of
ttlMs/cacheScope must be done by the caller via the lower-level
non-auto-paginating overloads, which surface those fields per page.
Fixes#1650: Log a warning (never throw) when a server that negotiated the
draft protocol version returns a cacheable result (tools/list, prompts/list,
resources/list, resources/templates/list, resources/read) without the now
required ttlMs/cacheScope fields. The warning is emitted at most once per
method per session so paginated listings do not produce one warning per page.
The raw cacheable overloads keep their synchronous argument validation and
route results through a shared ValidateCacheableResultAsync helper that calls
the new ValidateCacheableResult seam on McpClient. The seam is a no-op by
default and overridden by McpClientImpl to perform the conformance check.
Issue #1646 (optional client-side caching subsystem) was reviewed and closed
as not planned; no caching subsystem is added here.
/// Registers one or more tool definitions in the client's tool cache, enabling the transport
97
111
/// to send <c>Mcp-Param-*</c> headers for those tools without requiring a prior <see cref="McpClient.ListToolsAsync(RequestOptions?, CancellationToken)"/> call.
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received '{Method}' result missing required SEP-2549 field(s) '{MissingFields}' from a server that negotiated protocol version '{ProtocolVersion}'. The server may not be spec-compliant.")]
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received legacy '{Method}' JSON-RPC request on session that negotiated MRTR. The server should use InputRequiredResult instead of sending direct requests.")]
0 commit comments