Skip to main content
Glama
rainhan99

Cloud Manage MCP Server

by rainhan99

get_vultr_instance_bandwidth

Retrieve bandwidth usage data for a specific Vultr instance using the instance ID with Cloud Manage MCP Server, enabling efficient resource monitoring and management.

Instructions

获取Vultr实例带宽使用情况

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYes

Implementation Reference

  • main.py:547-553 (handler)
    The main MCP tool handler function for 'get_vultr_instance_bandwidth', decorated with @mcp.tool() which handles both registration and execution. It receives the instance_id parameter and delegates to the Vultr provider's method.
    @mcp.tool() def get_vultr_instance_bandwidth(instance_id: str) -> Dict: """ 获取Vultr实例带宽使用情况 """ return vultr_provider.get_instance_bandwidth(instance_id)
  • Core implementation logic in the VultrProvider class method. Makes an authenticated GET request to the Vultr API endpoint for instance bandwidth data, handles errors, and formats the response.
    def get_instance_bandwidth(self, instance_id: str) -> Dict: """ 获取实例的带宽使用情况 Args: instance_id (str): Vultr实例ID Returns: Dict: 带宽信息或错误信息 """ if not self.available: return { 'error': f'Vultr服务不可用: {getattr(self, "error", "未知错误")}', 'provider': 'vultr' } try: response = requests.get(f'{self.base_url}/instances/{instance_id}/bandwidth', headers=self.headers, timeout=10) if response.status_code != 200: return { 'error': f'获取带宽信息失败: {response.status_code} - {response.text}', 'provider': 'vultr' } data = response.json() return { 'provider': 'vultr', 'instance_id': instance_id, 'bandwidth_data': data.get('bandwidth', {}) } except Exception as e: return { 'error': f'获取带宽信息时发生错误: {str(e)}', 'provider': 'vultr' }
  • main.py:547-553 (registration)
    The @mcp.tool() decorator registers this function as an MCP tool named 'get_vultr_instance_bandwidth', with schema inferred from signature and docstring.
    @mcp.tool() def get_vultr_instance_bandwidth(instance_id: str) -> Dict: """ 获取Vultr实例带宽使用情况 """ return vultr_provider.get_instance_bandwidth(instance_id)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rainhan99/cloud_manage_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server