MCP PHP SDK

NotificationFilter

FinalYes

Which notification types a `subscriptions/listen` stream will carry.

An allow-list, not a hint: a server MUST NOT send types the client did not request, and an omitted field declines just as false does.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Properties

$promptsListChanged  : bool
$resourcesListChanged  : bool
$resourceSubscriptions  : array<string|int, mixed>
$toolsListChanged  : bool

Methods

__construct()  : mixed
carries()  : bool
Whether this filter admits $notification onto the stream.
fromParams()  : self
intersect()  : self
Narrows the filter to what this server can deliver, so the acknowledgment reflects the subset it agreed to honour rather than promising silence.
toAcknowledgedArray()  : array<string, mixed>
Agreed types only; declined ones are omitted rather than sent as `false`.

Properties

$resourceSubscriptions read-only

public array<string|int, mixed> $resourceSubscriptions = []

Methods

__construct()

public __construct([bool $toolsListChanged = false ][, bool $promptsListChanged = false ][, bool $resourcesListChanged = false ][, array<int, string> $resourceSubscriptions = [] ]) : mixed
Parameters
$toolsListChanged : bool = false
$promptsListChanged : bool = false
$resourcesListChanged : bool = false
$resourceSubscriptions : array<int, string> = []

resource URIs to report updates for

carries()

Whether this filter admits $notification onto the stream.

public carries(Notification $notification) : bool

An allow-list decision, so an unrecognized notification is declined: the server MUST NOT send a type the client did not ask for, and "did not ask for" includes types it has never heard of.

Parameters
$notification : Notification
Return values
bool

fromParams()

public static fromParams(array<string, mixed>|null $notifications) : self
Parameters
$notifications : array<string, mixed>|null

the request's params.notifications member

Return values
self

intersect()

Narrows the filter to what this server can deliver, so the acknowledgment reflects the subset it agreed to honour rather than promising silence.

public intersect(ServerCapabilities $capabilities) : self
Parameters
$capabilities : ServerCapabilities
Return values
self

toAcknowledgedArray()

Agreed types only; declined ones are omitted rather than sent as `false`.

public toAcknowledgedArray() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results