[mcp-tools] Use IndexMap for tool ordering

This commit is contained in:
Dylan Hurd
2025-08-25 07:31:34 -07:00
parent 295ca27e98
commit e573e9d435
9 changed files with 63 additions and 52 deletions
+1
View File
@@ -12,6 +12,7 @@ workspace = true
[dependencies]
base64 = "0.22.1"
indexmap = { version = "2.11.0", features = ["serde"] }
mcp-types = { path = "../mcp-types" }
mime_guess = "2.0.5"
serde = { version = "1", features = ["derive"] }
+2 -1
View File
@@ -10,6 +10,7 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;
use indexmap::IndexMap;
use mcp_types::CallToolResult;
use mcp_types::Tool as McpTool;
use serde::Deserialize;
@@ -798,7 +799,7 @@ pub struct GetHistoryEntryResponseEvent {
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct McpListToolsResponseEvent {
/// Fully qualified tool name -> tool definition.
pub tools: std::collections::HashMap<String, McpTool>,
pub tools: IndexMap<String, McpTool>,
}
#[derive(Debug, Default, Clone, Deserialize, Serialize)]