MCP PHP SDK

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
author

Kyrian Obikwelu koshnawaza@gmail.com

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

$experimental read-only

public array<string|int, mixed>|null $experimental = 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.context sub-capability

$samplingTools : bool|null = null

the sampling.tools sub-capability

$elicitationForm : bool|null = null

The elicitation.form sub-capability. Implied by declaring elicitation without naming any mode.

$elicitationUrl : bool|null = null

the elicitation.url sub-capability

The sub-capabilities trail extensions rather than sitting next to sampling and elicitation so 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
self

jsonSerialize()

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}|stdClass

withExtensions()

public withExtensions(array<string, mixed> $extensions) : self
Parameters
$extensions : array<string, mixed>
Return values
self

namesMode()

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
Return values
bool
On this page

Search results