ClientCapabilities

data class ClientCapabilities(val sampling: ClientCapabilities.Sampling? = null, val roots: ClientCapabilities.Roots? = null, val elicitation: JsonObject? = null, val experimental: JsonObject? = null, val extensions: Map<String, JsonObject>? = null)(source)

Capabilities that a client may support.

Known capabilities are defined here, but this is not a closed set: any client can define its own additional capabilities through the experimental field.

The presence of a capability object (non-null value) indicates that the client supports that capability.

Constructors

Link copied to clipboard
constructor(sampling: ClientCapabilities.Sampling? = null, roots: ClientCapabilities.Roots? = null, elicitation: JsonObject? = null, experimental: JsonObject? = null, extensions: Map<String, JsonObject>? = null)
constructor(sampling: JsonObject?, roots: ClientCapabilities.Roots? = null, elicitation: JsonObject? = null, experimental: JsonObject? = null, extensions: Map<String, JsonObject>? = null)

Source-compatibility constructor retaining the pre-SEP-1577 sampling: JsonObject? shape. Any non-null sampling is converted to an empty Sampling (sub-capabilities cannot be recovered from the old opaque JsonObject).

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Roots(val listChanged: Boolean? = null)

Indicates that the client supports listing roots.

Link copied to clipboard
data class Sampling(val context: JsonObject? = null, val tools: JsonObject? = null)

sub-capabilities for sampling.

Properties

Link copied to clipboard

Present if the client supports elicitation from the server.

Link copied to clipboard

Experimental, non-standard capabilities that the client supports. Keys are capability names, values are capability-specific configuration objects.

Link copied to clipboard

Optional extensions that the client supports. Keys are extension identifiers (e.g., "io.modelcontextprotocol/ui"), values are extension-specific settings objects.

Link copied to clipboard

Present if the client supports listing roots.

Link copied to clipboard

Present if the client supports sampling from an LLM. Use ClientCapabilities.Sampling to configure SEP-1577 sub-capabilities (tools, context).