mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix showing list of MCP tools
This commit is contained in:
parent
fe6c033427
commit
7dd54112cb
1 changed files with 13 additions and 9 deletions
|
@ -253,6 +253,7 @@ if MCP_AVAILABLE:
|
|||
"""
|
||||
list_tools_result: List[ListMCPToolsRestAPIResponseObject] = []
|
||||
for server in global_mcp_server_manager.mcp_servers:
|
||||
try:
|
||||
tools = await global_mcp_server_manager._get_tools_from_server(server)
|
||||
for tool in tools:
|
||||
list_tools_result.append(
|
||||
|
@ -263,6 +264,9 @@ if MCP_AVAILABLE:
|
|||
mcp_info=server.mcp_info,
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
verbose_logger.error(f"Error getting tools from {server.name}: {e}")
|
||||
continue
|
||||
return list_tools_result
|
||||
|
||||
@router.post("/tools/call", dependencies=[Depends(user_api_key_auth)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue