listTools method
List available tools on the server
Implementation
Future<List<Tool>> listTools() async {
if (!_initialized) {
throw McpError('Client is not initialized');
}
if (_serverCapabilities?.tools != true) {
throw McpError('Server does not support tools');
}
final response = await _sendRequest('tools/list', {});
final toolsList = response['tools'] as List<dynamic>;
return toolsList.map((tool) => Tool.fromJson(tool)).toList();
}