Document caching behavior and warn on non-conformant draft cacheable results (SEP-2549 follow-up) (#1669)
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
d6b1615988
commit
8e7f28c237
1 changed files with 428 additions and 10 deletions
|
|
@ -92,6 +92,20 @@ public abstract partial class McpClient : McpSession
|
|||
/// </summary>
|
||||
private protected abstract int MaxConsecutiveStuckPolls { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Inspects a received cacheable result (<c>tools/list</c>, <c>prompts/list</c>, <c>resources/list</c>,
|
||||
/// <c>resources/templates/list</c>, or <c>resources/read</c>) so derived clients can emit diagnostics.
|
||||
/// </summary>
|
||||
/// <param name="method">The request method that produced the result.</param>
|
||||
/// <param name="result">The cacheable result returned by the server.</param>
|
||||
/// <remarks>
|
||||
/// This is used to warn (never throw) when a server that negotiated a protocol version requiring the
|
||||
/// SEP-2549 <c>ttlMs</c>/<c>cacheScope</c> fields omits them. The default implementation does nothing.
|
||||
/// </remarks>
|
||||
private protected virtual void ValidateCacheableResult(string method, ICacheableResult result)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers one or more tool definitions in the client's tool cache, enabling the transport
|
||||
/// to send <c>Mcp-Param-*</c> headers for those tools without requiring a prior <see cref="McpClient.ListToolsAsync(RequestOptions?, CancellationToken)"/> call.
|
||||
|
|
|
|||
Loading…
Reference in a new issue