@@ -6,6 +6,7 @@ import { useMcpToolsStore } from '@/stores/mcpToolsStore'
66import { McpToolsService } from ' @/services/mcpToolsService'
77import { Table , TableBody , TableCell , TableHead , TableHeader , TableRow } from ' @/components/ui/table'
88import { Checkbox } from ' @/components/ui/checkbox'
9+ import { Input } from ' @/components/ui/input'
910import { Button } from ' @/components/ui/button'
1011import { ButtonGroup } from ' @/components/ui/button-group'
1112import { Spinner } from ' @/components/ui/spinner'
@@ -36,6 +37,7 @@ const isLoading = ref(true)
3637const error = ref <string | null >(null )
3738const selectedToolIds = ref <string []>([])
3839const isBulkToggling = ref (false )
40+ const searchQuery = ref (' ' )
3941
4042// Track expanded rows
4143const expandedRows = ref <Set <string >>(new Set ())
@@ -63,6 +65,19 @@ const calculateTokenPercentage = (tokenCount: number) => {
6365 return ` ${percentage .toFixed (1 )}% `
6466}
6567
68+ // Filter tools based on search query
69+ const filteredTools = computed (() => {
70+ if (! hasTools .value ) return []
71+ if (! searchQuery .value ) return tools .value .tools
72+
73+ const query = searchQuery .value .toLowerCase ()
74+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
75+ return tools .value .tools .filter ((tool : any ) =>
76+ tool .tool_name .toLowerCase ().includes (query ) ||
77+ (tool .description && tool .description .toLowerCase ().includes (query ))
78+ )
79+ })
80+
6681// Load tools on component mount
6782onMounted (async () => {
6883 await loadTools ()
@@ -250,8 +265,14 @@ async function handleBulkToggle(isDisabled: boolean) {
250265 :disabled-count =" disabledToolsCount"
251266 />
252267
253- <!-- Bulk Actions -->
254- <div class =" flex items-center justify-end gap-2 mb-4" >
268+ <!-- Search and Bulk Actions -->
269+ <div class =" flex items-center justify-between gap-4 mb-4" >
270+ <Input
271+ :placeholder =" t('mcpInstallations.details.tools.table.search')"
272+ v-model =" searchQuery"
273+ class =" max-w-sm"
274+ />
275+
255276 <ButtonGroup aria-label =" Bulk tool actions" >
256277 <Button
257278 variant =" outline"
@@ -296,7 +317,7 @@ async function handleBulkToggle(isDisabled: boolean) {
296317 </TableRow >
297318 </TableHeader >
298319 <TableBody >
299- <template v-for =" tool in tools . tools " :key =" tool .id " >
320+ <template v-for =" tool in filteredTools " :key =" tool .id " >
300321 <!-- Main Tool Row (clickable) -->
301322 <TableRow
302323 class =" cursor-pointer hover:bg-muted/50"
@@ -382,7 +403,7 @@ async function handleBulkToggle(isDisabled: boolean) {
382403 <div class =" flex-1 text-sm text-muted-foreground" >
383404 {{ t('mcpInstallations.details.tools.selection.rowsSelected', {
384405 selected: selectedToolIds.length,
385- total: tools.tools .length
406+ total: filteredTools .length
386407 }) }}
387408 </div >
388409 </div >
0 commit comments