SubscriptionFilter class final

The set of notification types a client may opt in to on a SubscriptionsListenRequestsubscriptions/listen request.

Each notification type is opt-in; the server MUST NOT send notification types the client has not explicitly requested here.

Revisions: 2026-07-28.

Inheritance
Available extensions

Constructors

SubscriptionFilter({bool? promptsListChanged, List<String>? resourceSubscriptions, bool? resourcesListChanged, bool? toolsListChanged, Map<String, Object?>? extra})
SubscriptionFilter.fromJson(Map<String, Object?> json)
Wraps json as received; nothing is dropped.

Properties

extra → Map<String, Object?>
Keys outside the schema (newer revisions, extensions, applications).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool

Available on SubscriptionFilter, provided by the SubscriptionFilterDecisions extension

Nothing requested.
no setter
promptsListChanged → bool?
If true, receive PromptListChangedNotificationnotifications/prompts/list_changed.
no setter
resourcesListChanged → bool?
If true, receive ResourceListChangedNotificationnotifications/resources/list_changed.
no setter
resourceSubscriptions → List<String>?
Subscribe to ResourceUpdatedNotificationnotifications/resources/updated for these resource URIs. Replaces the former resources/subscribe RPC.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaKeys → Set<String>
Property names the schema defines for this type.
no setteroverride
toolsListChanged → bool?
If true, receive ToolListChangedNotificationnotifications/tools/list_changed.
no setter
watchedTaskIds → List<String>

Available on SubscriptionFilter, provided by the SubscriptionFilterDecisions extension

Task ids this filter watches (tasks extension, taskIds).
no setter

Methods

$optional<T>(String key, T? read(Object? value, String path)) → T?
Optional property key, converted by read; null when absent or null.
inherited
$required<T>(String key, T read(Object? value, String path)) → T
Required property key, converted by read.
inherited
allows(String method, {String? uri, String? taskId}) → bool

Available on SubscriptionFilter, provided by the SubscriptionFilterDecisions extension

Whether a notification method (for uri, when it names one) passes.
check() → List<String>
Reads every property this type defines and returns what could not be read (missing required properties, wrong types), nested types included. Empty = the JSON matches the schema's shape for this type.
override
copyWith({bool? promptsListChanged, List<String>? resourceSubscriptions, bool? resourcesListChanged, bool? toolsListChanged}) → SubscriptionFilter
A copy with the given properties replaced; everything else, unknown keys included, is kept.
has(String key) → bool
Whether key is present (a null value counts as present).
inherited
honoredBy({required bool hasTools, required bool hasPrompts, required bool hasResources, bool? canSubscribe, bool ownsTask(String taskId)?}) → SubscriptionFilter

Available on SubscriptionFilter, provided by the SubscriptionFilterDecisions extension

The part of this filter a server with these capabilities honours.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The JSON form of this value.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
Equal when the JSON is equal; key order does not matter.
inherited
operator [](String key) → Object?
The raw JSON value of key.
inherited

Constants

keys → const Set<String>