Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions ui/src/components/onboarding/steps/ReviewStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,25 @@ export function ReviewStep({ onboardingData, isLoading, onBack, onSubmit }: Revi
{onboardingData.selectedTools && onboardingData.selectedTools.length > 0 ? (
<ScrollArea className="h-[100px] w-full rounded-md border p-3 bg-muted/50">
<div className="flex flex-wrap gap-2">
{onboardingData.selectedTools.map(tool => (
<Badge variant="secondary" key={tool.mcpServer?.name} className="flex items-center gap-1">
<FunctionSquare className="h-3 w-3" />
{tool.mcpServer?.name}
</Badge>
))}
{onboardingData.selectedTools.flatMap((tool, toolIndex) => {
const serverName = tool.mcpServer?.name || "unknown-server";
const toolNames = tool.mcpServer?.toolNames || [];

if (toolNames.length === 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we just ignore this and not even show anything? if there's no tools, the MCP server is useless

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, no point in showing it in the review if there are no tools. I'm updating the code.

return [];
}

return toolNames.map((toolName) => (
<Badge
variant="secondary"
key={`${serverName}-${toolName}-${toolIndex}`}
className="flex items-center gap-1"
>
<FunctionSquare className="h-3 w-3" />
{toolName}
</Badge>
));
})}
</div>
</ScrollArea>
) : (
Expand Down
8 changes: 5 additions & 3 deletions ui/src/components/onboarding/steps/ToolSelectionStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Info, ChevronDown, ChevronRight, FunctionSquare, Search } from 'lucide-react';
import { LoadingState } from "@/components/LoadingState";
import { ErrorState } from "@/components/ErrorState";
import { getToolResponseDisplayName, getToolResponseDescription, getToolResponseIdentifier, getToolResponseCategory, toolResponseToAgentTool } from "@/lib/toolUtils";
import { getToolResponseDisplayName, getToolResponseDescription, getToolResponseIdentifier, getToolResponseCategory, toolResponseToAgentTool, serverNamesMatch } from "@/lib/toolUtils";
import type { Tool, ToolsResponse } from "@/types";
import { Input } from "@/components/ui/input";

Expand Down Expand Up @@ -39,8 +39,10 @@ export function ToolSelectionStep({
if (tool.type === "Agent" && tool.agent) {
return false; // Agents don't match ToolResponse objects
} else if (tool.type === "McpServer" && tool.mcpServer) {
return tool.mcpServer.name === toolResponse.server_name &&
tool.mcpServer.toolNames.includes(toolResponse.id);
// server_name may be "namespace/name" while saved name can be just "name"
// (or vice versa), so normalize before comparing.
return serverNamesMatch(tool.mcpServer.name, toolResponse.server_name) &&
tool.mcpServer.toolNames.includes(toolResponse.id);
}
return false;
};
Expand Down