refactor: improve MCP connection test error handling in FuncCall

This commit is contained in:
LIghtJUNction
2026-03-24 02:56:43 +08:00
parent 9908f3b443
commit 08af1e0215

View File

@@ -135,7 +135,9 @@ class FuncCall(FunctionToolManager):
"""Test MCP server connection (stub implementation)."""
# Import the actual test function if available
try:
from astrbot._internal.protocols.mcp.client import _quick_test_mcp_connection
from astrbot._internal.protocols.mcp.client import (
_quick_test_mcp_connection,
)
success, message = await _quick_test_mcp_connection(config)
if not success:
raise Exception(message)