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