octomind 0.25.0

Session-based AI development assistant with conversational codebase interaction, multimodal vision support, built-in MCP tools, and multi-provider AI integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
// Copyright 2026 Muvon Un Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use clap::Args;

use octomind::config::{Config, McpConnectionType, McpServerConfig};
use octomind::directories;

#[derive(Args)]
pub struct ConfigArgs {
	/// Set the root-level model (provider:model format, e.g., openrouter:anthropic/claude-3.5-sonnet)
	#[arg(long)]
	pub model: Option<String>,

	/// Set API key for a provider (format: provider:key, e.g., openrouter:your-key)
	#[arg(long)]
	pub api_key: Option<String>,

	/// Set log level (none, info, debug)
	#[arg(long)]
	pub log_level: Option<String>,

	/// Set MCP providers
	#[arg(long)]
	pub mcp_providers: Option<String>,

	/// Add/configure MCP server (format: name,url=X|command=Y,args=Z)
	#[arg(long)]
	pub mcp_server: Option<String>,

	/// Set custom system prompt (or 'default' to reset to default)
	#[arg(long)]
	pub system: Option<String>,

	/// Enable markdown rendering for AI responses
	#[arg(long)]
	pub markdown_enable: Option<bool>,

	/// Set markdown theme (default, dark, light, ocean, solarized, monokai)
	#[arg(long)]
	pub markdown_theme: Option<String>,

	/// List all available markdown themes
	#[arg(long)]
	pub list_themes: bool,

	/// Show current configuration values with defaults
	#[arg(long)]
	pub show: bool,

	/// Validate configuration without making changes
	#[arg(long)]
	pub validate: bool,

	/// Upgrade config file to latest version
	#[arg(long)]
	pub upgrade: bool,
}

// Handle the configuration command
pub fn execute(args: &ConfigArgs, mut config: Config) -> Result<(), anyhow::Error> {
	// If list themes flag is set, display available themes and exit
	if args.list_themes {
		list_markdown_themes();
		return Ok(());
	}

	// If show flag is set, display current configuration with defaults and exit
	if args.show {
		show_configuration(&config)?;
		return Ok(());
	}

	// If validation flag is set, just validate and exit
	if args.validate {
		match config.validate() {
			Ok(()) => {
				println!("✅ Configuration is valid!");
				return Ok(());
			}
			Err(e) => {
				octomind::log_error!("❌ Configuration validation failed: {}", e);
				return Err(e);
			}
		}
	}

	// If upgrade flag is set, perform manual upgrade and exit
	if args.upgrade {
		let config_path = directories::get_config_file_path()?;
		octomind::config::migrations::force_upgrade_config(&config_path)?;
		return Ok(());
	}

	let mut modified = false;

	// Set root-level model if specified
	if let Some(model) = &args.model {
		// Validate model format
		if !model.contains(':') {
			octomind::log_error!("Error: Model must be in provider:model format (e.g., openrouter:anthropic/claude-3.5-sonnet)");
			return Ok(());
		}

		config.model = model.clone();
		println!("Set root-level model to {}", model);
		modified = true;
	}

	// Set API key for provider if specified
	if let Some(api_key_input) = &args.api_key {
		// Parse provider:key format
		let parts: Vec<&str> = api_key_input.splitn(2, ':').collect();
		if parts.len() != 2 {
			octomind::log_error!(
				"Error: API key must be in provider:key format (e.g., openrouter:your-key)"
			);
			return Ok(());
		}

		let provider = parts[0];

		// API keys are now only supported via environment variables for security
		octomind::log_error!(
			"❌ Error: API keys can no longer be set in config file for security reasons."
		);
		octomind::log_error!("Please set the API key as an environment variable instead:");
		octomind::log_error!(
			"  For {}: export {}_API_KEY=your-key-here",
			provider.to_uppercase(),
			provider.to_uppercase()
		);
		octomind::log_error!("  Then restart your shell and try again.");
		return Ok(());
	}

	// Set log level if specified
	if let Some(log_level_str) = &args.log_level {
		match log_level_str.to_lowercase().as_str() {
			"none" => {
				config.log_level = octomind::config::LogLevel::None;
				println!("Set log level to None");
			}
			"info" => {
				config.log_level = octomind::config::LogLevel::Info;
				println!("Set log level to Info");
			}
			"debug" => {
				config.log_level = octomind::config::LogLevel::Debug;
				println!("Set log level to Debug");
			}
			_ => {
				octomind::log_error!(
					"Error: Invalid log level '{}'. Valid options: none, info, debug",
					log_level_str
				);
				return Ok(());
			}
		}
		modified = true;
	}

	// Enable/disable MCP protocol - REMOVED: MCP is now controlled by role server_refs
	// MCP is enabled when roles have server_refs configured

	// Enable/disable markdown rendering
	if let Some(enable_markdown) = args.markdown_enable {
		config.enable_markdown_rendering = enable_markdown;
		println!(
			"Markdown rendering {}",
			if enable_markdown {
				"enabled"
			} else {
				"disabled"
			}
		);
		modified = true;
	}

	// Set markdown theme
	if let Some(theme) = &args.markdown_theme {
		let valid_themes = octomind::session::chat::markdown::MarkdownTheme::all_themes();
		if valid_themes.contains(&theme.as_str()) {
			config.markdown_theme = theme.clone();
			println!("Markdown theme set to '{}'", theme);
			modified = true;
		} else {
			octomind::log_error!(
				"Error: Invalid markdown theme '{}'. Valid themes: {}",
				theme,
				valid_themes.join(", ")
			);
			return Ok(());
		}
	}

	// Update MCP server references if specified
	if let Some(providers) = &args.mcp_providers {
		let server_names: Vec<String> =
			providers.split(',').map(|s| s.trim().to_string()).collect();

		// Clear existing servers and add new ones
		config.mcp.servers.clear();
		for server_name in &server_names {
			// Create basic server config if not exists
			if !config.mcp.servers.iter().any(|s| s.name() == *server_name) {
				let server = McpServerConfig::builtin(server_name, 30, Vec::new());
				config.mcp.servers.push(server);
			}
		}

		println!("Set MCP servers to: {}", providers);
		modified = true;
	}

	// Configure MCP server if specified
	if let Some(server_config) = &args.mcp_server {
		// Parse server config string: name,url=X|command=Y,args=Z
		let parts: Vec<&str> = server_config.split(',').collect();

		if parts.len() < 2 {
			println!("Invalid MCP server configuration format. Expected format: name,url=X|command=Y,args=Z");
		} else {
			let name = parts[0].trim().to_string();

			// Create a new server config - start with default values
			let mut url: Option<String> = None;
			let mut command: Option<String> = None;
			let mut args: Vec<String> = Vec::new();
			let mut timeout_seconds: u64 = 30;
			let mut connection_type = McpConnectionType::Http; // Default to HTTP

			// Process remaining parts
			for part in &parts[1..] {
				let kv: Vec<&str> = part.split('=').collect();
				if kv.len() == 2 {
					let key = kv[0].trim();
					let value = kv[1].trim();

					match key {
						"url" => {
							url = Some(value.to_string());
						}
						"command" => {
							command = Some(value.to_string());
						}
						"args" => {
							args = value
								.split(' ')
								.map(|s| s.trim().to_string())
								.filter(|s| !s.is_empty())
								.collect();
						}
						"type" => match value.to_lowercase().as_str() {
							"http" => connection_type = McpConnectionType::Http,
							"stdio" => connection_type = McpConnectionType::Stdin,
							"builtin" => connection_type = McpConnectionType::Builtin,
							_ => println!("Unknown server type: {}, defaulting to HTTP", value),
						},
						"timeout" | "timeout_seconds" => {
							if let Ok(timeout) = value.parse::<u64>() {
								timeout_seconds = timeout;
							} else {
								println!("Invalid timeout value: {}, using default", value);
							}
						}
						_ => {
							println!("Unknown server config key: {}", key);
						}
					}
				}
			}

			// Create the appropriate server configuration based on the collected data
			let server = match connection_type {
				McpConnectionType::Builtin => {
					McpServerConfig::builtin(&name, timeout_seconds, Vec::new())
				}
				McpConnectionType::Http => {
					if let Some(url) = url {
						// HTTP server - just needs a URL
						McpServerConfig::http(&name, &url, timeout_seconds, Vec::new())
					} else {
						println!("Error: URL must be specified for HTTP MCP server");
						return Ok(());
					}
				}
				McpConnectionType::Stdin => {
					if let Some(command) = command {
						McpServerConfig::stdin(&name, &command, args, timeout_seconds, Vec::new())
					} else {
						println!("Error: Command must be specified for stdin MCP server");
						return Ok(());
					}
				}
			};

			// Enable MCP if not already enabled - REMOVED: MCP now controlled by server_refs
			// The presence of servers in the registry doesn't automatically enable MCP

			// Add the new server to registry
			// Remove existing server with same name first
			config.mcp.servers.retain(|s| s.name() != name);
			// Add the server (name is already set during creation)
			config.mcp.servers.push(server);

			println!("Added/updated MCP server: {}", name);
			modified = true;
		}
	}

	// Update system prompt if specified
	if let Some(system_prompt) = &args.system {
		if system_prompt.to_lowercase() == "default" {
			// Reset to default
			config.system = None;
			println!("Reset system prompt to default");
		} else {
			// Set custom prompt
			config.system = Some(system_prompt.clone());
			println!("Set custom system prompt");
		}
		modified = true;
	}

	// If no modifications were made, create a default config
	if !modified {
		// Check if config file already exists
		let config_path = directories::get_config_file_path()?;

		if config_path.exists() {
			println!(
				"Configuration file already exists at: {}",
				config_path.display()
			);
			println!("No changes were made to the configuration.");
		} else {
			let config_path = Config::create_default_config()?;
			println!(
				"Created default configuration file at: {}",
				config_path.display()
			);
		}
	} else {
		// Save the updated configuration
		if let Err(e) = config.save() {
			octomind::log_error!("Error saving configuration: {}", e);
			return Err(e);
		}
		println!("Configuration saved successfully");
	}

	// Show current configuration
	println!("\nCurrent configuration:");

	// Show root-level model
	println!("Root model: {}", config.get_effective_model());

	// Show provider API keys (from environment variables only)
	println!("Provider API keys (from environment variables):");
	show_env_api_key_status("  OpenRouter", "OPENROUTER_API_KEY");
	show_env_api_key_status("  OpenAI", "OPENAI_API_KEY");
	show_env_api_key_status("  Anthropic", "ANTHROPIC_API_KEY");
	show_env_api_key_status("  Google", "GOOGLE_APPLICATION_CREDENTIALS");
	show_env_api_key_status("  Amazon", "AWS_ACCESS_KEY_ID");
	show_env_api_key_status("  Cloudflare", "CLOUDFLARE_API_TOKEN");

	// Show role configurations (models now use system-wide setting)
	println!("Role configurations:");

	// Show MCP status using the new structure
	// MCP is enabled per-role based on server_refs, not a global flag
	let dev_mcp_enabled = config
		.role_map
		.get("developer")
		.map(|r| !r.mcp.server_refs.is_empty())
		.unwrap_or(false);
	let ass_mcp_enabled = config
		.role_map
		.get("assistant")
		.map(|r| !r.mcp.server_refs.is_empty())
		.unwrap_or(false);

	println!("MCP status:");
	println!(
		"  Developer role: {}",
		if dev_mcp_enabled {
			"enabled"
		} else {
			"disabled"
		}
	);
	println!(
		"  Assistant role: {}",
		if ass_mcp_enabled {
			"enabled"
		} else {
			"disabled"
		}
	);

	// Show MCP servers from global config
	if !config.mcp.servers.is_empty() || dev_mcp_enabled || ass_mcp_enabled {
		if !config.mcp.servers.is_empty() {
			println!("MCP servers:");
			for server in &config.mcp.servers {
				let name = server.name();
				// Note: enabled status is now determined by role server_refs, not individual server config
				// Here we just show what's available in the registry

				// Auto-detect server type for display
				let effective_type = match name {
					"core" | "agent" => McpConnectionType::Builtin,
					_ => server.connection_type(),
				};

				match effective_type {
					McpConnectionType::Builtin => match name {
						"core" => {
							println!("  - {} (built-in core tools) - available", name)
						}
						"agent" => println!("  - {} (built-in agent tool) - available", name),
						_ => println!("  - {} (built-in tools) - available", name),
					},
					McpConnectionType::Http | McpConnectionType::Stdin => {
						if let Some(url) = server.url() {
							println!("  - {} (HTTP: {}) - available", name, url);
						} else if let Some(command) = server.command() {
							println!("  - {} (Command: {}) - available", name, command);
						} else {
							println!(
								"  - {} (external, not configured) - needs configuration",
								name
							);
						}
					}
				}
			}
		} else {
			println!("MCP servers: None configured");
		}
	}

	println!("Log level: {:?}", config.log_level);
	println!(
		"Markdown rendering: {}",
		if config.enable_markdown_rendering {
			"enabled"
		} else {
			"disabled"
		}
	);
	println!("Markdown theme: {}", config.markdown_theme);

	// Show system prompt status
	if config.system.is_some() {
		println!("System prompt: Custom");
	} else {
		println!("System prompt: Default");
	}

	Ok(())
}

/// Display available markdown themes with descriptions
fn list_markdown_themes() {
	println!("🎨 Available Markdown Themes\n");

	let themes = vec![
		(
			"default",
			"Improved default theme with gold headers and enhanced contrast",
			"Most terminal setups",
		),
		(
			"dark",
			"Optimized for dark terminals with bright, vibrant colors",
			"Dark terminal backgrounds",
		),
		(
			"light",
			"Perfect for light terminal backgrounds with darker colors",
			"Light terminal backgrounds",
		),
		(
			"ocean",
			"Beautiful blue-green palette inspired by ocean themes",
			"Users who prefer calm, aquatic colors",
		),
		(
			"solarized",
			"Based on the popular Solarized color scheme",
			"Fans of the classic Solarized palette",
		),
		(
			"monokai",
			"Inspired by the popular Monokai syntax highlighting theme",
			"Users familiar with Monokai from code editors",
		),
	];

	for (name, description, best_for) in themes {
		println!("📝 {}", name.to_uppercase());
		println!("   Description: {}", description);
		println!("   Best for:    {}", best_for);
		println!("   Usage:       octomind config --markdown-theme {}", name);
		println!();
	}

	println!("💡 Tips:");
	println!("   • Themes work in sessions, ask command, and multimode");
	println!("   • Enable markdown rendering: octomind config --markdown-enable true");
	println!("   • View current theme: octomind config --show");
}

/// Display comprehensive configuration information with defaults
fn show_configuration(config: &Config) -> Result<(), anyhow::Error> {
	println!("🔧 Octomind Configuration\n");

	// Configuration file location
	let config_path = directories::get_config_file_path()?;
	if config_path.exists() {
		println!("📁 Config file: {}", config_path.display());
	} else {
		println!(
			"📁 Config file: {} (not created yet)",
			config_path.display()
		);
	}
	println!();

	// Root-level configuration
	println!("🌍 System-wide Settings");
	println!(
		"  Model (root):              {}",
		if config.model.is_empty() || config.model == "openrouter:anthropic/claude-3.5-haiku" {
			format!("{} (default)", config.get_effective_model())
		} else {
			config.model.clone()
		}
	);
	println!("  Log level:                 {:?}", config.log_level);
	println!(
		"  Markdown rendering:        {}",
		if config.enable_markdown_rendering {
			"enabled"
		} else {
			"disabled"
		}
	);
	println!("  Markdown theme:            {}", config.markdown_theme);
	println!(
		"  MCP response warning:      {} tokens",
		config.mcp_response_warning_threshold
	);
	println!(
		"  Max session tokens:        {} tokens ({})",
		config.max_session_tokens_threshold,
		if config.max_session_tokens_threshold > 0 {
			"enabled"
		} else {
			"disabled"
		}
	);
	println!(
		"  Cache threshold:           {} tokens",
		config.cache_tokens_threshold
	);
	println!(
		"  Cache timeout:             {} seconds",
		config.cache_timeout_seconds
	);
	println!();

	// Provider API keys (from environment variables only)
	println!("🔑 Provider API Keys (from environment variables)");
	show_env_api_key_status("OpenRouter", "OPENROUTER_API_KEY");
	show_env_api_key_status("OpenAI", "OPENAI_API_KEY");
	show_env_api_key_status("Anthropic", "ANTHROPIC_API_KEY");
	show_env_api_key_status("Google", "GOOGLE_APPLICATION_CREDENTIALS");
	show_env_api_key_status("Amazon", "AWS_ACCESS_KEY_ID");
	show_env_api_key_status("Cloudflare", "CLOUDFLARE_API_TOKEN");
	println!();

	// Role configurations
	println!("👤 Role Configurations");

	// Developer role
	println!("  Developer Role:");
	let (_dev_config, dev_mcp, _dev_layers, _dev_commands, dev_system) =
		config.get_role_config("developer");

	println!(
		"    Model:           {} (system-wide)",
		config.get_effective_model()
	);
	println!("    System prompt:   {} chars", dev_system.len());

	// Assistant role
	println!("  Assistant Role:");
	let (_ass_config, ass_mcp, _ass_layers, _ass_commands, ass_system) =
		config.get_role_config("assistant");
	println!(
		"    Model:           {} (system-wide)",
		config.get_effective_model()
	);
	println!("    System prompt:   {} chars", ass_system.len());
	println!();

	// MCP Configuration
	println!("🔧 MCP (Model Context Protocol) Configuration");

	// Global MCP
	println!("  Global MCP:");
	println!(
		"    Registry:        {} servers configured",
		config.mcp.servers.len()
	);
	if !config.mcp.servers.is_empty() {
		show_mcp_servers(&config.mcp.servers);
	}

	// Developer role MCP
	println!("  Developer Role MCP:");
	println!(
		"    Server refs:     {}",
		if dev_mcp.server_refs.is_empty() {
			"None (MCP disabled)".to_string()
		} else {
			dev_mcp.server_refs.join(", ")
		}
	);

	// Assistant role MCP
	println!("  Assistant Role MCP:");
	println!(
		"    Server refs:     {}",
		if ass_mcp.server_refs.is_empty() {
			"None (MCP disabled)".to_string()
		} else {
			ass_mcp.server_refs.join(", ")
		}
	);
	println!();

	// Layer configurations (used by workflows)
	let has_any_workflow = config.role_map.values().any(|r| r.workflow.is_some());
	if has_any_workflow {
		println!("📚 Layer Configurations (used by workflows)");

		// Show available layers from global registry
		if let Some(layers) = &config.layers {
			println!("  Configured Layers: {} available", layers.len());
			for layer in layers {
				println!("{} (temp: {:.1})", layer.name, layer.temperature);
			}
		}

		// Show workflow assignments per role
		println!("\n  Workflow Assignments:");
		for (role_name, role_data) in &config.role_map {
			if let Some(workflow) = &role_data.workflow {
				println!("    {}{}", role_name, workflow);
			}
		}

		println!();
	}

	Ok(())
}

/// Show the status of an API key with environment variable fallback
fn show_env_api_key_status(provider: &str, env_var: &str) {
	match std::env::var(env_var) {
		Ok(value) if !value.trim().is_empty() => {
			// Use environment tracker to determine actual source
			let tracker = octomind::config::get_env_tracker();
			let source_desc = tracker.lock().unwrap().get_source_description(env_var);
			println!("{:<15} ✅ Set via {}", provider, source_desc);
		}
		_ => {
			// Either not set or empty value
			println!(
				"{:<15} ❌ Not set (export {}=your-key or add to .env)",
				provider, env_var
			);
		}
	}
}

/// Display MCP server configurations
fn show_mcp_servers(servers: &[McpServerConfig]) {
	if servers.is_empty() {
		println!("    Servers:         None configured");
		return;
	}

	println!("    Servers:");
	for server in servers {
		let name = server.name();
		// Note: Individual servers no longer have enabled flag - determined by role server_refs

		// Auto-detect server type for display
		let effective_type = match name {
			"core" | "agent" => McpConnectionType::Builtin,
			_ => server.connection_type(),
		};

		match effective_type {
			McpConnectionType::Builtin => match name {
				"core" => println!("      📦 {} (built-in core tools)", name),
				"agent" => println!("      🤖 {} (built-in agent tool)", name),
				_ => println!("      📦 {} (built-in tools)", name),
			},
			McpConnectionType::Http | McpConnectionType::Stdin => {
				if let Some(url) = server.url() {
					println!("      🌐 {} (HTTP: {})", name, url);
				} else if let Some(command) = server.command() {
					println!("      ⚙️  {} (Command: {})", name, command);
				} else {
					println!("{} (external, not configured)", name);
				}
			}
		}

		// Show additional server details if configured
		if server.timeout_seconds() != 30 {
			println!("        Timeout: {} seconds", server.timeout_seconds());
		}
		if !server.tools().is_empty() {
			println!("        Tools: {}", server.tools().join(", "));
		}
	}
}