A modern (2026-07-28) server's answer to server/discover.
supported_versions-supportedVersions, in the server's order.capabilities- the server'sServerCapabilities, string-keyed.instructions- optional server instructions, ornil.ttl_ms- how long the result may be cached. An absent, negative or non-integerttlMsreads as0, as the caching page requires; any upper clamp is the cache's job.cache_scope-:publicor:private. Anything else (or absent) reads as:private, the scope that never shares across credentials.server_info-_meta["io.modelcontextprotocol/serverInfo"]as aConduitMcp.Client.ServerInfo, ornilwhen absent or malformed (it is a SHOULD, and display-only).meta- the result's_meta, or%{}.raw- the whole string-keyed wire map.
Summary
Functions
Builds a DiscoverResult from a server/discover result map.
Types
@type t() :: %ConduitMcp.Client.DiscoverResult{ cache_scope: :public | :private, capabilities: map(), instructions: String.t() | nil, meta: map(), raw: map(), server_info: ConduitMcp.Client.ServerInfo.t() | nil, supported_versions: [String.t()], ttl_ms: non_neg_integer() }
Functions
@spec from_wire(term()) :: {:ok, t()} | {:error, ConduitMcp.Client.Error.t()}
Builds a DiscoverResult from a server/discover result map.
supportedVersions must be a list of strings and capabilities an
object, and resultType must be absent or "complete"; otherwise the
result is a :protocol error with reason :invalid_discover_result.
iex> {:ok, result} =
...> ConduitMcp.Client.DiscoverResult.from_wire(%{
...> "resultType" => "complete",
...> "supportedVersions" => ["2026-07-28"],
...> "capabilities" => %{"tools" => %{}},
...> "ttlMs" => 60_000,
...> "cacheScope" => "public"
...> })
iex> {result.supported_versions, result.ttl_ms, result.cache_scope}
{["2026-07-28"], 60000, :public}