The notifications filter of a subscriptions/listen request
(SubscriptionFilter), reduced to the subset this server honours.
parse/3 turns the request's params into a t/0:
:ack— thenotificationsobject ofnotifications/subscriptions/acknowledged: only the fields honoured, each with the value honoured;:topics— theConduitMcp.Subscriptionstopics the stream registers under;:kinds— the honoured fields as atoms, for telemetry (never URIs).
Fields
toolsListChanged,promptsListChanged,resourcesListChanged— a boolean.trueis honoured when the server advertises the matching capability (ConduitMcp.Capabilities.build/2): an Endpoint without prompts omitspromptsListChangedfrom the acknowledgment, as the specification asks.falsesubscribes to nothing.resourceSubscriptions— a list of at most 1000 URI strings. Each is authorized likeresources/read(the resource'sscope) and, when the server definesConduitMcp.Server.handle_subscribe_resource/2, must also be accepted by it ({:ok, _}) — the same hook legacyresources/subscriberuns. A URI the caller may not read, or the hook refuses, is dropped from the acknowledgment silently, exactly as if it had not been requested, so the acknowledgment reveals nothing beyond what the caller may read. Duplicates are collapsed; an empty result omits the field.taskIds— only whileConduitMcp.Ext.Tasksis enabled (otherwise an unknown field): a list of at most 1000 task ids fornotifications/tasks. The request must declare theio.modelcontextprotocol/tasksextension in its client capabilities (-32021withdata.requiredCapabilitiesotherwise, as the extension requires). Each id is kept only if the task exists and is owned by the caller (ConduitMcp.Principal.id/1, the owner check oftasks/get); any other id is dropped silently, so a foreign id and an unknown one look the same. The stream then receives a task's changes only while its principal is the task's owner (SV-1): the topic is keyed by owner. Duplicates are collapsed; an empty result omits the field.
A field of the wrong type, a notifications that is not an object, or
more than 1000 URIs or task ids is -32602. Unknown fields (a newer
revision's, or an extension's this server does not enable) are not
honoured and are omitted from the acknowledgment.
Summary
Functions
The most URIs one resourceSubscriptions may name (1000).
Parses the params of a subscriptions/listen request for
server_module, authorizing resource URIs against conn.
Types
@type t() :: %ConduitMcp.Subscriptions.Filter{ ack: %{optional(String.t()) => boolean() | [String.t()]}, kinds: [atom()], topics: [ConduitMcp.Subscriptions.topic()] }
An honoured filter; see the moduledoc.
Functions
@spec max_resource_subscriptions() :: pos_integer()
The most URIs one resourceSubscriptions may name (1000).
@spec parse(map(), module(), Plug.Conn.t() | map()) :: {:ok, t()} | {:error, integer(), String.t(), map() | nil}
Parses the params of a subscriptions/listen request for
server_module, authorizing resource URIs against conn.