@@ -191,7 +191,8 @@ async def tools_metadata(tool_ids: List[str]) -> List[Dict[str, Any]]:
191
191
data : List [Dict [str , Any ]] = response .json ()
192
192
if tool_ids == ["0" ]:
193
193
return data
194
- return [tool for tool in data if str (tool .get ("id" )) in tool_ids ]
194
+
195
+ return [tool for tool in data if tool ["id" ] in tool_ids ]
195
196
196
197
197
198
async def get_prompts_from_mcp_server (catalog_urls : List [str ]) -> List [str ]:
@@ -313,7 +314,7 @@ async def handle_list_tools() -> List[types.Tool]:
313
314
RuntimeError: If an error occurs during fetching or processing.
314
315
"""
315
316
try :
316
- tool_ids = ["0" ] if not SERVER_CATALOG_URLS else await get_tools_from_mcp_server (SERVER_CATALOG_URLS )
317
+ tool_ids = ["0" ] if SERVER_CATALOG_URLS [ 0 ] == BASE_URL else await get_tools_from_mcp_server (SERVER_CATALOG_URLS )
317
318
metadata = await tools_metadata (tool_ids )
318
319
tools = []
319
320
for tool in metadata :
@@ -392,7 +393,7 @@ async def handle_list_resources() -> List[types.Resource]:
392
393
RuntimeError: If an error occurs during fetching or processing.
393
394
"""
394
395
try :
395
- ids = ["0" ] if not SERVER_CATALOG_URLS else await get_resources_from_mcp_server (SERVER_CATALOG_URLS )
396
+ ids = ["0" ] if SERVER_CATALOG_URLS [ 0 ] == BASE_URL else await get_resources_from_mcp_server (SERVER_CATALOG_URLS )
396
397
meta = await resources_metadata (ids )
397
398
resources = []
398
399
for r in meta :
@@ -455,7 +456,7 @@ async def handle_list_prompts() -> List[types.Prompt]:
455
456
RuntimeError: If an error occurs during fetching or processing.
456
457
"""
457
458
try :
458
- ids = ["0" ] if not SERVER_CATALOG_URLS else await get_prompts_from_mcp_server (SERVER_CATALOG_URLS )
459
+ ids = ["0" ] if SERVER_CATALOG_URLS [ 0 ] == BASE_URL else await get_prompts_from_mcp_server (SERVER_CATALOG_URLS )
459
460
meta = await prompts_metadata (ids )
460
461
prompts = []
461
462
for p in meta :
0 commit comments