Skip to content

Commit a93e0ae

Browse files
committed
chore: Fixed ToolUse UX for MCP Tools
1 parent fe94368 commit a93e0ae

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,15 +3471,6 @@ impl ChatSession {
34713471
parent_message_id: None,
34723472
};
34733473
self.stdout.send(Event::ToolCallStart(tool_call_start))?;
3474-
} else if let Tool::Custom(ref tool) = tool_use.tool {
3475-
queue!(
3476-
self.stdout,
3477-
StyledText::reset(),
3478-
style::Print(" from mcp server "),
3479-
StyledText::emphasis_fg(),
3480-
style::Print(&tool.server_name),
3481-
StyledText::reset(),
3482-
)?;
34833474
}
34843475

34853476
tool_use

crates/chat-cli/src/cli/chat/tools/custom_tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl CustomTool {
150150
queue!(
151151
output,
152152
style::Print("Running "),
153-
StyledText::success_fg(),
153+
StyledText::brand_fg(),
154154
style::Print(&self.name),
155155
StyledText::reset(),
156156
)?;

crates/chat-cli/src/cli/chat/tools/mod.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,27 @@ impl Tool {
214214
queue,
215215
style,
216216
};
217-
queue!(
218-
output,
219-
StyledText::secondary_fg(),
220-
style::Print(" (using tool: "),
221-
style::Print(self.display_name()),
222-
style::Print(")"),
223-
StyledText::reset(),
224-
)?;
217+
if let Tool::Custom(tool) = self {
218+
queue!(
219+
output,
220+
StyledText::secondary_fg(),
221+
style::Print(" (from mcp server: "),
222+
style::Print(&tool.server_name),
223+
style::Print(", using tool: "),
224+
style::Print(self.display_name()),
225+
style::Print(")"),
226+
StyledText::reset(),
227+
)?;
228+
} else {
229+
queue!(
230+
output,
231+
StyledText::secondary_fg(),
232+
style::Print(" (using tool: "),
233+
style::Print(self.display_name()),
234+
style::Print(")"),
235+
StyledText::reset(),
236+
)?;
237+
}
225238
};
226239

227240
Ok(())

0 commit comments

Comments
 (0)