check_provider_availability
Verify the operational status of specified cloud service providers like AWS, DigitalOcean, Vultr, or Alibaba to ensure their availability, returning detailed provider-specific information.
Instructions
检查特定云服务提供商的可用性
Args:
provider_name (str): 提供商名称 ('aws', 'digitalocean', 'vultr', 'alibaba')
Returns:
Dict: 提供商可用性信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| provider_name | Yes |
Implementation Reference
- main.py:660-700 (handler)The core handler function decorated with @mcp.tool(), which both implements the tool logic and registers it with the MCP server. It checks provider availability by inspecting environment variables and the provider object's status.@mcp.tool() def check_provider_availability(provider_name: str) -> Dict: """ 检查特定云服务提供商的可用性 Args: provider_name (str): 提供商名称 ('aws', 'digitalocean', 'vultr', 'alibaba') Returns: Dict: 提供商可用性信息 """ if provider_name not in PROVIDERS: return { 'error': f'不支持的提供商: {provider_name}', 'supported_providers': list(PROVIDERS.keys()) } provider = PROVIDERS[provider_name] provider_info = get_cloud_provider_info(provider_name) # 检查必要的环境变量 required_env_vars = { 'aws': ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY'], 'digitalocean': ['DIGITALOCEAN_TOKEN'], 'vultr': ['VULTR_API_KEY'], 'alibaba': ['ALIBABA_CLOUD_ACCESS_KEY_ID', 'ALIBABA_CLOUD_ACCESS_KEY_SECRET'] } env_status = {} if provider_name in required_env_vars: for env_var in required_env_vars[provider_name]: env_status[env_var] = bool(os.getenv(env_var)) return { 'provider': provider_name, 'provider_info': provider_info, 'available': getattr(provider, 'available', False), 'error': getattr(provider, 'error', None), 'environment_variables': env_status, 'all_env_vars_set': all(env_status.values()) if env_status else False }
- main.py:660-660 (registration)The @mcp.tool() decorator registers the check_provider_availability function as an MCP tool.@mcp.tool()