@@ -7,7 +7,7 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
77import { Info , ChevronDown , ChevronRight , FunctionSquare , Search } from 'lucide-react' ;
88import { LoadingState } from "@/components/LoadingState" ;
99import { ErrorState } from "@/components/ErrorState" ;
10- import { getToolResponseDisplayName , getToolResponseDescription , getToolResponseIdentifier , getToolResponseCategory , toolResponseToAgentTool } from "@/lib/toolUtils" ;
10+ import { getToolResponseDisplayName , getToolResponseDescription , getToolResponseIdentifier , getToolResponseCategory , toolResponseToAgentTool , serverNamesMatch } from "@/lib/toolUtils" ;
1111import type { Tool , ToolsResponse } from "@/types" ;
1212import { Input } from "@/components/ui/input" ;
1313
@@ -39,8 +39,10 @@ export function ToolSelectionStep({
3939 if ( tool . type === "Agent" && tool . agent ) {
4040 return false ; // Agents don't match ToolResponse objects
4141 } else if ( tool . type === "McpServer" && tool . mcpServer ) {
42- return tool . mcpServer . name === toolResponse . server_name &&
43- tool . mcpServer . toolNames . includes ( toolResponse . id ) ;
42+ // server_name may be "namespace/name" while saved name can be just "name"
43+ // (or vice versa), so normalize before comparing.
44+ return serverNamesMatch ( tool . mcpServer . name , toolResponse . server_name ) &&
45+ tool . mcpServer . toolNames . includes ( toolResponse . id ) ;
4446 }
4547 return false ;
4648 } ;
0 commit comments