listResourcesPage method
Future<ListResourcesResult>
listResourcesPage({
- String? cursor,
- Map<
String, dynamic> ? meta, - RequestOptions? options,
One page of resources/list: pass the previous page's nextCursor as
cursor for the next one.
Implementation
Future<ListResourcesResult> listResourcesPage({String? cursor, Map<String, dynamic>? meta, RequestOptions? options}) async {
if (!_initialized) {
throw McpError('Client is not initialized');
}
if (!_statelessMode && _serverCapabilities?.resources != true) {
throw McpError('Server does not support resources');
}
final response = await _sendRequest(
'resources/list', _withMeta({if (cursor != null) 'cursor': cursor}, meta), options);
return ListResourcesResult.fromJson(Map<String, dynamic>.from(response as Map));
}