Skip to main content
Glama
rainhan99

Cloud Manage MCP Server

by rainhan99

list_digitalocean_droplets

Retrieve a list of all DigitalOcean droplets to monitor status, manage resources, and perform operations on cloud servers.

Instructions

列出所有DigitalOcean Droplets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:460-460 (registration)
    Registration of the list_digitalocean_droplets tool using @mcp.tool() decorator
    @mcp.tool()
  • main.py:460-466 (handler)
    Handler function for the MCP tool 'list_digitalocean_droplets', which delegates to the DigitalOcean provider's list_droplets method.
    @mcp.tool()
    def list_digitalocean_droplets() -> Dict:
        """
        列出所有DigitalOcean Droplets
        """
        return digitalocean_provider.list_droplets()
  • Core helper method in DigitalOceanProvider class that lists all droplets using the pydo Client API, formats them, and handles errors.
    def list_droplets(self) -> Dict:
        """
        列出所有Droplets
        
        Returns:
            Dict: Droplets列表或错误信息
        """
        if not self.available:
            return {
                'error': f'DigitalOcean服务不可用: {getattr(self, "error", "未知错误")}',
                'provider': 'digitalocean'
            }
        
        try:
            response = self.client.droplets.list()
            droplets = response.get("droplets", [])
            
            droplet_list = []
            for droplet in droplets:
                droplet_info = self._format_droplet_summary(droplet)
                droplet_list.append(droplet_info)
            
            return {
                'provider': 'digitalocean',
                'total_droplets': len(droplet_list),
                'droplets': droplet_list
            }
            
        except Exception as e:
            return {
                'error': f'获取Droplets列表时发生错误: {str(e)}',
                'provider': 'digitalocean'
            }
  • Supporting helper function that formats individual droplet data into a summary for the list output.
    def _format_droplet_summary(self, droplet: Dict) -> Dict:
        """格式化Droplet摘要信息"""
        networks = droplet.get("networks", {})
        public_ip = None
        private_ip = None
        
        for net in networks.get("v4", []):
            if net.get("type") == "public":
                public_ip = net.get("ip_address")
            elif net.get("type") == "private":
                private_ip = net.get("ip_address")
        
        return {
            'id': droplet.get("id"),
            'name': droplet.get("name"),
            'status': droplet.get("status"),
            'size_slug': droplet.get("size_slug"),
            'memory': droplet.get("memory"),
            'vcpus': droplet.get("vcpus"),
            'disk': droplet.get("disk"),
            'region': droplet.get("region", {}).get("name"),
            'public_ipv4': public_ip,
            'private_ipv4': private_ip,
            'created_at': droplet.get("created_at"),
            'tags': droplet.get("tags", [])
        }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states it lists droplets but doesn't disclose behavioral traits such as whether it requires authentication, rate limits, pagination, or what the output format includes. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Chinese ('列出所有DigitalOcean Droplets'), which is appropriately sized and front-loaded with the core action. There's no wasted text, making it highly concise and well-structured for its purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, with no annotations and a read operation, it should ideally mention output characteristics or usage context. It's complete enough for a simple list tool but lacks depth for full agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The description doesn't add parameter semantics, but with no parameters, a baseline of 4 is appropriate as it doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '列出所有DigitalOcean Droplets' clearly states the verb ('列出' meaning 'list') and resource ('DigitalOcean Droplets'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_digitalocean_droplet_info' or 'list_aws_instances', which would require mentioning it returns all droplets without filtering or that it's specific to DigitalOcean (though implied by name).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose it over 'get_digitalocean_droplet_info' (for single droplet details) or 'list_aws_instances' (for other providers), nor does it specify any prerequisites or exclusions. Usage is implied by the name but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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