File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
frontend/src/components/agents/mcp Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1384,7 +1384,19 @@ async def get_agents(
1384
1384
filtered_agents = []
1385
1385
tools_filter = []
1386
1386
if tools :
1387
- tools_filter = [tool .strip () for tool in tools .split (',' ) if tool .strip ()]
1387
+ # Handle case where tools might be passed as dict instead of string
1388
+ if isinstance (tools , str ):
1389
+ tools_filter = [tool .strip () for tool in tools .split (',' ) if tool .strip ()]
1390
+ elif isinstance (tools , dict ):
1391
+ # If tools is a dict, log the issue and skip filtering
1392
+ logger .warning (f"Received tools parameter as dict instead of string: { tools } " )
1393
+ tools_filter = []
1394
+ elif isinstance (tools , list ):
1395
+ # If tools is a list, use it directly
1396
+ tools_filter = [str (tool ).strip () for tool in tools if str (tool ).strip ()]
1397
+ else :
1398
+ logger .warning (f"Unexpected tools parameter type: { type (tools )} , value: { tools } " )
1399
+ tools_filter = []
1388
1400
1389
1401
for agent in agents_data :
1390
1402
# Get version data if available and extract configuration
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const API_URL = process.env.NEXT_PUBLIC_BACKEND_URL || '';
15
15
interface CustomMCPDialogProps {
16
16
open : boolean ;
17
17
onOpenChange : ( open : boolean ) => void ;
18
- onSave : ( config : CustomMCPConfiguration ) => Promise < void > ;
18
+ onSave : ( config : CustomMCPConfiguration ) => void ;
19
19
}
20
20
21
21
interface CustomMCPConfiguration {
@@ -145,7 +145,7 @@ export const CustomMCPDialog: React.FC<CustomMCPDialogProps> = ({
145
145
try {
146
146
let configToSave : any = { url : configText . trim ( ) } ;
147
147
148
- await onSave ( {
148
+ onSave ( {
149
149
name : serverName ,
150
150
type : serverType ,
151
151
config : configToSave ,
You can’t perform that action at this time.
0 commit comments