diff --git a/crates/agent_servers/src/claude/mcp_server.rs b/crates/agent_servers/src/claude/mcp_server.rs index 468027c4c3dd4c3391dc8196e54a840ce01a965b..2405603550db376453b85261ca31b5791e464d09 100644 --- a/crates/agent_servers/src/claude/mcp_server.rs +++ b/crates/agent_servers/src/claude/mcp_server.rs @@ -19,7 +19,7 @@ use util::debug_panic; use crate::claude::{ McpServerConfig, - tools::{ClaudeTool, EditToolParams, EditToolResponse, ReadToolParams, ReadToolResponse}, + tools::{ClaudeTool, EditToolParams, ReadToolParams}, }; pub struct ClaudeMcpServer { @@ -179,11 +179,9 @@ impl ClaudeMcpServer { let input = serde_json::from_value(request.arguments.context("Arguments required")?)?; - let result = Self::handle_read_tool_call(input, delegate, cx).await?; + let content = Self::handle_read_tool_call(input, delegate, cx).await?; Ok(CallToolResponse { - content: vec![ToolResponseContent::Text { - text: serde_json::to_string(&result)?, - }], + content, is_error: None, meta: None, }) @@ -191,11 +189,9 @@ impl ClaudeMcpServer { let input = serde_json::from_value(request.arguments.context("Arguments required")?)?; - let result = Self::handle_edit_tool_call(input, delegate, cx).await?; + Self::handle_edit_tool_call(input, delegate, cx).await?; Ok(CallToolResponse { - content: vec![ToolResponseContent::Text { - text: serde_json::to_string(&result)?, - }], + content: vec![], is_error: None, meta: None, }) @@ -209,7 +205,7 @@ impl ClaudeMcpServer { params: ReadToolParams, delegate: AcpClientDelegate, cx: &AsyncApp, - ) -> Task> { + ) -> Task>> { cx.foreground_executor().spawn(async move { let response = delegate .read_text_file(ReadTextFileParams { @@ -219,9 +215,9 @@ impl ClaudeMcpServer { }) .await?; - Ok(ReadToolResponse { - content: response.content, - }) + Ok(vec![ToolResponseContent::Text { + text: response.content, + }]) }) } @@ -229,7 +225,7 @@ impl ClaudeMcpServer { params: EditToolParams, delegate: AcpClientDelegate, cx: &AsyncApp, - ) -> Task> { + ) -> Task> { cx.foreground_executor().spawn(async move { let response = delegate .read_text_file_reusing_snapshot(ReadTextFileParams { @@ -251,7 +247,7 @@ impl ClaudeMcpServer { }) .await?; - Ok(EditToolResponse) + Ok(()) }) } diff --git a/crates/agent_servers/src/claude/tools.rs b/crates/agent_servers/src/claude/tools.rs index 9c82139a07f38d9f78df8fa4719ecba420cd8838..75a26ee23096da3c03b25ae7335337e455e9d6f7 100644 --- a/crates/agent_servers/src/claude/tools.rs +++ b/crates/agent_servers/src/claude/tools.rs @@ -434,10 +434,6 @@ pub struct EditToolParams { pub new_text: String, } -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct EditToolResponse; - #[derive(Deserialize, JsonSchema, Debug)] pub struct ReadToolParams { /// The absolute path to the file to read. @@ -450,12 +446,6 @@ pub struct ReadToolParams { pub limit: Option, } -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ReadToolResponse { - pub content: String, -} - #[derive(Deserialize, JsonSchema, Debug)] pub struct WriteToolParams { /// Absolute path for new file