#!/usr/bin/env python3
"""直接测试FastMCP工具列表"""
import sys
import os

# 添加项目路径到Python路径
sys.path.insert(0, "/app/auto-mcp-upload/data/5139/src")

# 禁用后端检查
os.environ["NO_DEPS_CHECK"] = "1"

from code_sandbox_mcp.server import mcp

# 获取所有工具
print("正在获取工具列表...")
tools = mcp._tool_manager.list_tools()

print(f"\n✅ 成功获取到 {len(tools)} 个工具:")
for i, tool in enumerate(tools, 1):
    name = tool.name
    description = tool.description
    print(f"  {i}. {name}")
    print(f"     描述: {description}")
    if hasattr(tool, 'parameters'):
        params = tool.parameters.model_dump() if hasattr(tool.parameters, 'model_dump') else tool.parameters
        if 'properties' in params:
            param_names = list(params['properties'].keys())
            print(f"     参数: {param_names}")
    print()

print("✅ 工具列表测试成功!")