feat: friendly display for MCP tool names in frontend (#715)
- Format MCP tool names from "mcp_my_server_search_docs" to "My Server Search Docs" in the agent stream UI - Apply same formatting in sanitizeForDisplay for inline text - Update tool-icons.ts getToolDisplayName with MCP support
This commit is contained in:
@@ -69,6 +69,14 @@ const toolDisplayNameKeys: Record<string, string> = {
|
||||
// Get tool display name (user-friendly, localized)
|
||||
export function getToolDisplayName(toolName: string): string {
|
||||
const key = toolDisplayNameKeys[toolName];
|
||||
return key ? t(key) : toolName;
|
||||
if (key) return t(key);
|
||||
|
||||
// Format MCP tool names: "mcp_service_tool" → "Service Tool"
|
||||
if (toolName.startsWith('mcp_')) {
|
||||
const parts = toolName.slice(4).split('_');
|
||||
return parts.map(p => p.charAt(0).toUpperCase() + p.slice(1)).join(' ');
|
||||
}
|
||||
|
||||
return toolName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user