diff --git a/crates/goose-mcp/src/jetbrains/proxy.rs b/crates/goose-mcp/src/jetbrains/proxy.rs index 2003735ca..747d9bf59 100644 --- a/crates/goose-mcp/src/jetbrains/proxy.rs +++ b/crates/goose-mcp/src/jetbrains/proxy.rs @@ -134,16 +134,16 @@ impl JetBrainsProxy { } let tools_response: Value = response.json().await?; - let tools = tools_response["tools"] + let tools = tools_response .as_array() .ok_or_else(|| anyhow!("Invalid tools response format"))? .iter() .filter_map(|t| { - if let (Some(name), Some(description)) = (t["name"].as_str(), t["description"].as_str()) { + if let (Some(name), Some(description), Some(input_schema)) = (t["name"].as_str(), t["description"].as_str(), t["input_schema"].as_str()) { Some(Tool { name: name.to_string(), description: description.to_string(), - input_schema: serde_json::json!({}), + input_schema: serde_json::json!(input_schema), }) } else { None @@ -225,4 +225,4 @@ impl Clone for JetBrainsProxy { client: Client::new(), } } -} \ No newline at end of file +} diff --git a/crates/goose-server/src/commands/mod.rs b/crates/goose-server/src/commands/mod.rs index 7a158cf1b..9de800dea 100644 --- a/crates/goose-server/src/commands/mod.rs +++ b/crates/goose-server/src/commands/mod.rs @@ -1,3 +1,2 @@ pub mod agent; pub mod mcp; -pub mod router_enum; diff --git a/crates/goose-server/src/commands/router_enum.rs b/crates/goose-server/src/commands/router_enum.rs deleted file mode 100644 index b6e93cde0..000000000 --- a/crates/goose-server/src/commands/router_enum.rs +++ /dev/null @@ -1,67 +0,0 @@ -use std::pin::Pin; -use std::future::Future; - -use goose_mcp::{DeveloperRouter, JetBrainsRouter}; -use mcp_core::{ - protocol::{JsonRpcRequest, JsonRpcResponse, ServerCapabilities}, - Content, Resource, Tool, ToolError, - handler::ResourceError, -}; -use mcp_server::Router; - -#[derive(Clone)] -pub enum RouterEnum { - Developer(DeveloperRouter), - JetBrains(JetBrainsRouter), -} - -impl Router for RouterEnum { - fn name(&self) -> String { - match self { - RouterEnum::Developer(router) => router.name(), - RouterEnum::JetBrains(router) => router.name(), - } - } - - fn instructions(&self) -> String { - match self { - RouterEnum::Developer(router) => router.instructions(), - RouterEnum::JetBrains(router) => router.instructions(), - } - } - - fn capabilities(&self) -> ServerCapabilities { - match self { - RouterEnum::Developer(router) => router.capabilities(), - RouterEnum::JetBrains(router) => router.capabilities(), - } - } - - fn list_tools(&self) -> Vec { - match self { - RouterEnum::Developer(router) => router.list_tools(), - RouterEnum::JetBrains(router) => router.list_tools(), - } - } - - fn call_tool(&self, name: &str, params: serde_json::Value) -> Pin, ToolError>> + Send + 'static>> { - match self { - RouterEnum::Developer(router) => router.call_tool(name, params), - RouterEnum::JetBrains(router) => router.call_tool(name, params), - } - } - - fn list_resources(&self) -> Vec { - match self { - RouterEnum::Developer(router) => router.list_resources(), - RouterEnum::JetBrains(router) => router.list_resources(), - } - } - - fn read_resource(&self, path: &str) -> Pin> + Send + 'static>> { - match self { - RouterEnum::Developer(router) => router.read_resource(path), - RouterEnum::JetBrains(router) => router.read_resource(path), - } - } -} \ No newline at end of file