Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent: Namespace MCP server tools (#30600)
Bennet Bo Fenner21bd91a77383
diff --git a/crates/agent/src/agent_configuration.rs b/crates/agent/src/agent_configuration.rsindex 8f7346c00b2..be2d1da51b2 100644--- a/crates/agent/src/agent_configuration.rs+++ b/crates/agent/src/agent_configuration.rs@@ -637,7 +637,7 @@ impl AgentConfiguration {.hover(|style| style.bg(cx.theme().colors().element_hover)).rounded_sm().child(- Label::new(tool.name())+ Label::new(tool.ui_name()).buffer_font(cx).size(LabelSize::Small),)diff --git a/crates/agent/src/agent_configuration/tool_picker.rs b/crates/agent/src/agent_configuration/tool_picker.rsindex 5ac2d4496b5..b14de9e4475 100644--- a/crates/agent/src/agent_configuration/tool_picker.rs+++ b/crates/agent/src/agent_configuration/tool_picker.rs@@ -117,7 +117,7 @@ impl ToolPickerDelegate {ToolSource::Native => {if mode == ToolPickerMode::BuiltinTools {items.extend(tools.into_iter().map(|tool| PickerItem::Tool {- name: tool.name().into(),+ name: tool.ui_name().into(),server_id: None,}));}@@ -129,7 +129,7 @@ impl ToolPickerDelegate {server_id: server_id.clone(),});items.extend(tools.into_iter().map(|tool| PickerItem::Tool {- name: tool.name().into(),+ name: tool.ui_name().into(),server_id: Some(server_id.clone()),}));}diff --git a/crates/agent/src/context_server_tool.rs b/crates/agent/src/context_server_tool.rsindex 68ffefb1264..af799838536 100644--- a/crates/agent/src/context_server_tool.rs+++ b/crates/agent/src/context_server_tool.rs@@ -30,6 +30,10 @@ impl ContextServerTool {impl Tool for ContextServerTool {fn name(&self) -> String {+ format!("{}-{}", self.server_id, self.tool.name)+ }++ fn ui_name(&self) -> String {self.tool.name.clone()}diff --git a/crates/assistant_tool/src/assistant_tool.rs b/crates/assistant_tool/src/assistant_tool.rsindex ecda105f6dc..3691ad10c39 100644--- a/crates/assistant_tool/src/assistant_tool.rs+++ b/crates/assistant_tool/src/assistant_tool.rs@@ -203,6 +203,11 @@ pub trait Tool: 'static + Send + Sync {/// Returns the name of the tool.fn name(&self) -> String;+ /// Returns the name to be displayed in the UI for this tool.+ fn ui_name(&self) -> String {+ self.name()+ }+/// Returns the description of the tool.fn description(&self) -> String;