pub struct DiscoverResult {
pub cache_scope: DiscoverResultCacheScope,
pub capabilities: ServerCapabilities,
pub instructions: Option<String>,
pub meta: Option<ResultMetaObject>,
pub result_type: String,
pub supported_versions: Vec<String>,
pub ttl_ms: u64,
}Expand description
Latest MCP Protocol 2026_07_28 The result returned by the server for a {@link DiscoverRequestserver/discover} request.
JSON schema
{
"description": "The result returned by the server for a {@link DiscoverRequestserver/discover} request.",
"type": "object",
"required": [
"cacheScope",
"capabilities",
"resultType",
"supportedVersions",
"ttlMs"
],
"properties": {
"_meta": {
"$ref": "#/$defs/ResultMetaObject"
},
"cacheScope": {
"description": "Indicates the intended scope of the cached response, analogous to HTTP\nCache-Control: public vs Cache-Control: private.\n\n- \"public\": The response does not contain user-specific data. Any\n client or intermediary (e.g., shared gateway, caching proxy) MAY cache\n the response and serve it across authorization contexts.\n- \"private\": The response MAY be cached and reused only within the\n same authorization context. Caches MUST NOT be shared across\n authorization contexts (e.g., a different access token requires a\n different cache).",
"type": "string",
"enum": [
"private",
"public"
]
},
"capabilities": {
"description": "The capabilities of the server.",
"$ref": "#/$defs/ServerCapabilities"
},
"instructions": {
"description": "Natural-language guidance describing the server and its features.\n\nThis can be used by clients to improve an LLM's understanding of\navailable tools (e.g., by including it in a system prompt). It should\nfocus on information that helps the model use the server effectively\nand should not duplicate information already in tool descriptions.",
"type": "string"
},
"resultType": {
"description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\nresultType), the client MUST treat the absent field as \"complete\".",
"type": "string"
},
"supportedVersions": {
"description": "MCP Protocol Versions this server supports. The client should choose a\nversion from this list for use in subsequent requests.",
"type": "array",
"items": {
"type": "string"
}
},
"ttlMs": {
"description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
"type": "integer",
"minimum": 0.0
}
}
}Fields§
§cache_scope: DiscoverResultCacheScopeIndicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private. - “public”: The response does not contain user-specific data. Any client or intermediary (e.g., shared gateway, caching proxy) MAY cache the response and serve it across authorization contexts. - “private”: The response MAY be cached and reused only within the same authorization context. Caches MUST NOT be shared across authorization contexts (e.g., a different access token requires a different cache).
capabilities: ServerCapabilitiesThe capabilities of the server.
instructions: Option<String>Natural-language guidance describing the server and its features. This can be used by clients to improve an LLM’s understanding of available tools (e.g., by including it in a system prompt). It should focus on information that helps the model use the server effectively and should not duplicate information already in tool descriptions.
meta: Option<ResultMetaObject>§result_type: StringIndicates the type of the result, which allows the client to determine how to parse the result object. Servers implementing this protocol version MUST include this field. For backward compatibility, when a client receives a result from a server implementing an earlier protocol version (which does not include resultType), the client MUST treat the absent field as “complete”.
supported_versions: Vec<String>MCP Protocol Versions this server supports. The client should choose a version from this list for use in subsequent requests.
ttl_ms: u64A hint from the server indicating how long (in milliseconds) the client MAY cache this response before re-fetching. Semantics are analogous to HTTP Cache-Control max-age. - If 0, The response SHOULD be considered immediately stale, The client MAY re-fetch every time the result is needed. - If positive, the client SHOULD consider the result fresh for this many milliseconds after receiving the response.
Trait Implementations§
Source§impl Clone for DiscoverResult
impl Clone for DiscoverResult
Source§fn clone(&self) -> DiscoverResult
fn clone(&self) -> DiscoverResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more