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
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
$promptsListChanged read-only
public
bool
$promptsListChanged
= false
$resourcesListChanged read-only
public
bool
$resourcesListChanged
= false
$resourceSubscriptions read-only
public
array<string|int, mixed>
$resourceSubscriptions
= []
$toolsListChanged read-only
public
bool
$toolsListChanged
= false
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
boolfromParams()
public
static fromParams(array<string, mixed>|null $notifications) : self
Parameters
- $notifications : array<string, mixed>|null
-
the request's
params.notificationsmember
Return values
selfintersect()
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
selftoAcknowledgedArray()
Agreed types only; declined ones are omitted rather than sent as `false`.
public
toAcknowledgedArray() : array<string, mixed>