ClientCapabilities class final

Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.

Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.

Inheritance

Constructors

ClientCapabilities({Map<String, Map<String, Object?>>? experimental, ClientCapabilitiesRoots? roots, ClientCapabilitiesSampling? sampling, ClientCapabilitiesElicitation? elicitation, ClientCapabilitiesTasks? tasks, Map<String, Map<String, Object?>>? extensions, Map<String, Object?>? extra})
ClientCapabilities.fromJson(Map<String, Object?> json)
Wraps json as received; nothing is dropped.

Properties

elicitation → ClientCapabilitiesElicitation?
Present if the client supports elicitation from the server.
no setter
experimental → Map<String, Map<String, Object?>>?
Experimental, non-standard capabilities that the client supports.
no setter
extensions → Map<String, Map<String, Object?>>?
Optional MCP extensions that the client supports. Keys are extension identifiers (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are per-extension settings objects. An empty object indicates support with no settings.
no setter
extra → Map<String, Object?>
Keys outside the schema (newer revisions, extensions, applications).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
roots → ClientCapabilitiesRoots?
Present if the client supports listing roots.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampling → ClientCapabilitiesSampling?
Present if the client supports sampling from an LLM.
no setter
schemaKeys → Set<String>
Property names the schema defines for this type.
no setteroverride
tasks → ClientCapabilitiesTasks?
Present if the client supports task-augmented requests.
no setter

Methods

$optional<T>(String key, T? read(Object? value, String path)) → T?
Optional property key, converted by read; null when absent or null.
inherited
$required<T>(String key, T read(Object? value, String path)) → T
Required property key, converted by read.
inherited
check() → List<String>
Reads every property this type defines and returns what could not be read (missing required properties, wrong types), nested types included. Empty = the JSON matches the schema's shape for this type.
override
copyWith({Map<String, Map<String, Object?>>? experimental, ClientCapabilitiesRoots? roots, ClientCapabilitiesSampling? sampling, ClientCapabilitiesElicitation? elicitation, ClientCapabilitiesTasks? tasks, Map<String, Map<String, Object?>>? extensions}) → ClientCapabilities
A copy with the given properties replaced; everything else, unknown keys included, is kept.
has(String key) → bool
Whether key is present (a null value counts as present).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The JSON form of this value.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
Equal when the JSON is equal; key order does not matter.
inherited
operator [](String key) → Object?
The raw JSON value of key.
inherited

Constants

keys → const Set<String>