TsgcWSAPIClient_MCPMethods › UnsubscribeResource

UnsubscribeResource Method

Cancels a previous resource subscription (resources/unsubscribe).

Syntax

procedure UnsubscribeResource(const aUri: string);

Parameters

NameTypeDescription
aUriconst stringURI of the resource whose subscription should be terminated. Must match a URI previously passed to SubscribeResource.

Remarks

Sends the JSON-RPC resources/unsubscribe request so the server stops emitting notifications/resources/updated notifications for the given URI. Call this method during teardown, when the user navigates away from the resource, or before closing the transport. Unsubscribing a URI that was never subscribed is a no-op at the client level and may return an error from the server.

Example

MCP.UnsubscribeResource('file:///project/config.yaml');

Back to Methods