diff --git a/src/tools/calculator.rs b/src/tools/calculator.rs index a968bf3..e88e4c1 100644 --- a/src/tools/calculator.rs +++ b/src/tools/calculator.rs @@ -189,7 +189,7 @@ impl ToolProvider for CalculatorTool { Tool { name: "calculator".to_string(), description: "Advanced calculator supporting arithmetic, scientific, and trigonometric operations".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties: schema_properties, required: vec!["operation".to_string(), "a".to_string()], diff --git a/src/tools/file_system/directory.rs b/src/tools/file_system/directory.rs index a5ca2e4..959f1f4 100644 --- a/src/tools/file_system/directory.rs +++ b/src/tools/file_system/directory.rs @@ -49,7 +49,7 @@ impl ToolProvider for DirectoryTool { Tool { name: "directory".to_string(), description: "Directory operations including create, list, and move files.".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties: schema_properties, required: vec!["operation".to_string()], diff --git a/src/tools/file_system/read.rs b/src/tools/file_system/read.rs index 4f44930..f82a1c2 100644 --- a/src/tools/file_system/read.rs +++ b/src/tools/file_system/read.rs @@ -71,7 +71,7 @@ impl ToolProvider for ReadFileTool { name: "read_file".to_string(), description: "Read the complete contents of one or more files from the file system. \ Handles various text encodings and provides detailed error messages.".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties: schema_properties, required: vec!["operation".to_string()], diff --git a/src/tools/file_system/search.rs b/src/tools/file_system/search.rs index 7370445..5c91260 100644 --- a/src/tools/file_system/search.rs +++ b/src/tools/file_system/search.rs @@ -89,7 +89,7 @@ impl ToolProvider for SearchTool { Tool { name: "search".to_string(), description: "Search for files and get file information.".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties: schema_properties, required: vec!["operation".to_string()], diff --git a/src/tools/file_system/write.rs b/src/tools/file_system/write.rs index 5602bdd..3aac559 100644 --- a/src/tools/file_system/write.rs +++ b/src/tools/file_system/write.rs @@ -45,7 +45,7 @@ impl ToolProvider for WriteFileTool { Tool { name: "write_file".to_string(), description: "Write content to a file. Creates a new file or overwrites existing one.".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties: schema_properties, required: vec!["operation".to_string(), "path".to_string(), "content".to_string()], diff --git a/src/tools/mod.rs b/src/tools/mod.rs index 1e2769d..29ff647 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -36,7 +36,7 @@ impl ToolType { pub struct Tool { pub name: String, pub description: String, - pub input_schema: ToolInputSchema, + pub inputSchema: ToolInputSchema, } #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/tools/test_tool.rs b/src/tools/test_tool.rs index a97ba40..e3d10cc 100644 --- a/src/tools/test_tool.rs +++ b/src/tools/test_tool.rs @@ -18,7 +18,7 @@ impl ToolProvider for TestTool { Tool { name: "test_tool".to_string(), description: "Test Tool".to_string(), - input_schema: serde_json::from_str(r#"{ + inputSchema: serde_json::from_str(r#"{ "type": "object", "properties": { "test": { @@ -54,7 +54,7 @@ impl ToolProvider for PingTool { Tool { name: "ping_tool".to_string(), description: "Ping Tool".to_string(), - input_schema: serde_json::from_str(r#"{ + inputSchema: serde_json::from_str(r#"{ "type": "object", "properties": { "server": { diff --git a/src/transport/mod.rs b/src/transport/mod.rs index a8a343c..4eed521 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -249,8 +249,7 @@ impl SseTransport { .stream(async_stream::stream! { yield Ok::<_, warp::Error>(warp::sse::Event::default() .event("endpoint") - .json_data(&EndpointEvent { endpoint }) - .unwrap()); + .data(endpoint)); let mut broadcast_rx = broadcast_rx; while let Ok(msg) = broadcast_rx.recv().await { diff --git a/tests/tools.rs b/tests/tools.rs index 1f1179a..8949323 100644 --- a/tests/tools.rs +++ b/tests/tools.rs @@ -38,7 +38,7 @@ impl ToolProvider for MockCalculatorTool { Tool { name: "calculator".to_string(), description: "Performs basic arithmetic operations".to_string(), - input_schema: ToolInputSchema { + inputSchema: ToolInputSchema { schema_type: "object".to_string(), properties, required: vec!["operation", "a", "b"].iter().map(|s| s.to_string()).collect(),