unsubscribeResource method
Unsubscribes the active MCP session from resource updates.
Implementation
Future<void> unsubscribeResource(
String uri, {
Object? id,
String? protocolVersion,
Map<String, String> headers = const <String, String>{},
}) async {
final resourceUri = _validatedMcpResourceUri(uri, 'uri');
final response = await request(
'resources/unsubscribe',
id: id,
params: <String, Object?>{'uri': resourceUri},
protocolVersion: protocolVersion,
headers: headers,
);
_jsonRpcResultFrom(response, method: 'resources/unsubscribe');
}