ClientCapabilities implements JsonSerializable
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.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $elicitation : bool|null
- $elicitationForm : bool|null
- $elicitationUrl : bool|null
- $experimental : array<string|int, mixed>|null
- $extensions : array<string|int, mixed>|null
- $roots : bool|null
- $rootsListChanged : bool|null
- $sampling : bool|null
- $samplingContext : bool|null
- $samplingTools : bool|null
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : array{roots?: object, sampling?: object, elicitation?: object, experimental?: object, extensions?: object}|stdClass
- withExtensions() : self
- namesMode() : bool
- A mode is declared by the presence of a (possibly empty) object, so only the key matters — not whatever it holds. A boolean `elicitation` names none.
Properties
$elicitation read-only
public
bool|null
$elicitation
= null
$elicitationForm read-only
public
bool|null
$elicitationForm
= null
$elicitationUrl read-only
public
bool|null
$elicitationUrl
= null
$experimental read-only
public
array<string|int, mixed>|null
$experimental
= null
$extensions read-only
public
array<string|int, mixed>|null
$extensions
= null
$roots read-only
public
bool|null
$roots
= false
$rootsListChanged read-only
public
bool|null
$rootsListChanged
= null
$sampling read-only
public
bool|null
$sampling
= null
$samplingContext read-only
public
bool|null
$samplingContext
= null
$samplingTools read-only
public
bool|null
$samplingTools
= null
Methods
__construct()
public
__construct([bool|null $roots = false ][, bool|null $rootsListChanged = null ][, bool|null $sampling = null ][, bool|null $elicitation = null ][, array<string, mixed> $experimental = null ][, array<string, mixed>|null $extensions = null ][, bool|null $samplingContext = null ][, bool|null $samplingTools = null ][, bool|null $elicitationForm = null ][, bool|null $elicitationUrl = null ]) : mixed
Parameters
- $roots : bool|null = false
- $rootsListChanged : bool|null = null
- $sampling : bool|null = null
- $elicitation : bool|null = null
- $experimental : array<string, mixed> = null
- $extensions : array<string, mixed>|null = null
-
protocol extensions the client supports (e.g. io.modelcontextprotocol/ui)
- $samplingContext : bool|null = null
-
the
sampling.contextsub-capability - $samplingTools : bool|null = null
-
the
sampling.toolssub-capability - $elicitationForm : bool|null = null
-
The
elicitation.formsub-capability. Implied by declaringelicitationwithout naming any mode. - $elicitationUrl : bool|null = null
-
the
elicitation.urlsub-capabilityThe sub-capabilities trail
extensionsrather than sitting next tosamplingandelicitationso that existing positional calls keep working. Pass them by name.
fromArray()
public
static fromArray(array{roots?: array{listChanged?: bool}, sampling?: array{context?: mixed, tools?: mixed}|object, elicitation?: array{form?: mixed, url?: mixed}|object|bool, experimental?: array, extensions?: array} $data) : self
Parameters
-
$data
: array{roots?: array{listChanged?: bool}, sampling?: array{context?: mixed, tools?: mixed}|object, elicitation?: array{form?: mixed, url?: mixed}|object|bool, experimental?: array
, extensions?: array }
Return values
selfjsonSerialize()
public
jsonSerialize() : array{roots?: object, sampling?: object, elicitation?: object, experimental?: object, extensions?: object}|stdClass
Return values
array{roots?: object, sampling?: object, elicitation?: object, experimental?: object, extensions?: object}|stdClasswithExtensions()
public
withExtensions(array<string, mixed> $extensions) : self
Parameters
- $extensions : array<string, mixed>
Return values
selfnamesMode()
A mode is declared by the presence of a (possibly empty) object, so only the key matters — not whatever it holds. A boolean `elicitation` names none.
private
static namesMode(mixed $capability, string $name) : bool
Parameters
- $capability : mixed
- $name : string