withSubscriptionId

Stamp the draft io.modelcontextprotocol/subscriptionId (MetaKey.subscriptionId) into params._meta of a JSON-RPC notification and return it, leaving the original untouched. Per draft basic/utilities/subscriptions every notification delivered on a subscriptions/listen stream MUST carry the listen request's id as subscriptionId in _meta, so clients can correlate the notification with the listen request that established the stream — this is the producer for that key. subscriptionId is the (string-rendered) JSON-RPC id of the originating subscriptions/listen request. An empty subscriptionId is a no-op (the notification is returned unchanged). Notifications carry their payload under params, so the key is nested as params._meta.<subscriptionId>.

@safe @safe
Json
withSubscriptionId