Class DiscoverResult
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents the result returned from a ServerDiscover request.
public sealed class DiscoverResult : Result, ICacheableResult
- Inheritance
-
DiscoverResult
- Implements
- Inherited Members
Remarks
Introduced by the 2026-07-28 protocol revision (SEP-2575) as the canonical way for a client
to learn what a server supports without performing the legacy initialize handshake.
Properties
CacheScope
Gets or sets the intended scope of the cached response.
[JsonPropertyName("cacheScope")]
[JsonConverter(typeof(CacheScopeConverter))]
public CacheScope? CacheScope { get; set; }
Property Value
Remarks
When this property is null (the field was absent from the response), clients should treat the response as Public.
An unrecognized or future scope value sent by a server (or a non-string value) is tolerated and surfaced as null rather than causing deserialization of the whole result to fail, so a single unexpected hint never prevents a client from reading the result.
Capabilities
Gets or sets the capabilities of the server.
[JsonPropertyName("capabilities")]
public required ServerCapabilities Capabilities { get; set; }
Property Value
Instructions
Gets or sets optional instructions describing how to use the server and its features.
[JsonPropertyName("instructions")]
public string? Instructions { get; set; }
Property Value
Remarks
This can be used by clients to improve an LLM's understanding of the server, for example by including it in a system prompt.
ServerInfo
Gets or sets information about the server implementation.
[JsonPropertyName("serverInfo")]
public required Implementation ServerInfo { get; set; }
Property Value
SupportedVersions
Gets or sets the list of MCP protocol version strings that the server supports.
[JsonPropertyName("supportedVersions")]
public required IList<string> SupportedVersions { get; set; }
Property Value
Remarks
The client should choose a version from this list for use in subsequent requests.
TimeToLive
Gets or sets a hint indicating how long the client may cache this response before re-fetching.
[JsonPropertyName("ttlMs")]
[JsonConverter(typeof(TimeSpanMillisecondsConverter))]
public TimeSpan? TimeToLive { get; set; }
Property Value
Remarks
The semantics are analogous to the HTTP Cache-Control: max-age directive. The value is
serialized as an integer number of milliseconds under the ttlMs JSON property.
A value of Zero indicates the response should be considered immediately stale; a positive value indicates the client should consider the response fresh for that duration from the time it was received.
When this property is null (the field was absent from the response), clients should assume a default of Zero (immediately stale) and rely on their own caching heuristics or notifications. The SDK preserves whatever value the server sent and does not coerce it; a client that receives a negative value should treat it as immediately stale.