Skip to content

Commit 0a4e37c

Browse files
authored
Prd 4987 (#505)
* Highlight active tools in available tools list * Add changeset
1 parent 9ee6443 commit 0a4e37c

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

.changeset/yellow-windows-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@inkeep/agents-manage-ui": patch
3+
---
4+
5+
Highlight active tools in available tools list

agents-manage-ui/src/components/mcp-servers/available-tools-card.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ChevronDown, ChevronUp } from 'lucide-react';
22
import { useState } from 'react';
3-
import type { MCPTool } from "@/lib/types/tools";;
3+
import type { MCPTool } from '@/lib/types/tools';
4+
import { cn } from '@/lib/utils';
45
import { getTypeBadgeVariant, parseMCPInputSchema } from '@/lib/utils/mcp-schema-parser';
56
import { Badge } from '../ui/badge';
67
import { Button } from '../ui/button';
@@ -11,9 +12,10 @@ interface ToolCardProps {
1112
description?: string;
1213
inputSchema?: any;
1314
};
15+
isActive: boolean;
1416
}
1517

16-
function ToolCard({ tool }: ToolCardProps) {
18+
function ToolCard({ tool, isActive }: ToolCardProps) {
1719
const [isExpanded, setIsExpanded] = useState(false);
1820
const [showFullDescription, setShowFullDescription] = useState(false);
1921

@@ -33,7 +35,10 @@ function ToolCard({ tool }: ToolCardProps) {
3335
{/* Tool header */}
3436
<div className="flex items-center justify-between">
3537
<div className="flex items-center gap-2">
36-
<Badge variant="code" className="bg-transparent text-foreground">
38+
<Badge
39+
variant={isActive ? 'primary' : 'code'}
40+
className={cn(!isActive && 'bg-transparent text-foreground')}
41+
>
3742
{tool.name}
3843
</Badge>
3944
{parsedSchema?.hasProperties && (
@@ -97,7 +102,13 @@ function ToolCard({ tool }: ToolCardProps) {
97102
);
98103
}
99104

100-
export function AvailableToolsCard({ tools }: { tools: MCPTool['availableTools'] }) {
105+
export function AvailableToolsCard({
106+
tools,
107+
activeTools,
108+
}: {
109+
tools: MCPTool['availableTools'];
110+
activeTools: MCPTool['config']['mcp']['activeTools'];
111+
}) {
101112
if (!tools) return null; // parent component already makes sure to handle this
102113

103114
return (
@@ -109,9 +120,11 @@ export function AvailableToolsCard({ tools }: { tools: MCPTool['availableTools']
109120
</Badge>
110121
</div>
111122
<div className="space-y-2">
112-
{tools.map((availableTool) => (
113-
<ToolCard key={availableTool.name} tool={availableTool} />
114-
))}
123+
{tools.map((availableTool) => {
124+
const isActive =
125+
activeTools === undefined ? true : activeTools?.includes(availableTool.name);
126+
return <ToolCard key={availableTool.name} tool={availableTool} isActive={!!isActive} />;
127+
})}
115128
</div>
116129
</div>
117130
);

agents-manage-ui/src/components/mcp-servers/view-mcp-server-details.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ export function ViewMCPServerDetails({
276276

277277
{/* Available Tools */}
278278
{tool.availableTools && tool.availableTools.length > 0 && (
279-
<AvailableToolsCard tools={tool.availableTools} />
279+
<AvailableToolsCard
280+
tools={tool.availableTools}
281+
activeTools={tool.config.mcp.activeTools}
282+
/>
280283
)}
281284
</div>
282285
</div>

0 commit comments

Comments
 (0)