Skip to main content
Glama
rainhan99

Cloud Manage MCP Server

by rainhan99

power_on_digitalocean_droplet

Start a DigitalOcean droplet with triple confirmation for IP, name, and operation to ensure accurate power management.

Instructions

开启DigitalOcean Droplet(需要三次确认)

Args:
    droplet_id (int): Droplet ID
    ip_confirmation (str): 确认IP地址
    name_confirmation (str): 确认Droplet名称
    operation_confirmation (str): 确认操作类型(输入"开机"或"power_on")
    
Returns:
    Dict: 操作结果或确认要求

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
droplet_idYes
ip_confirmationNo
name_confirmationNo
operation_confirmationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:395-417 (handler)
    The MCP tool handler function for 'power_on_digitalocean_droplet'. It is registered via @mcp.tool() decorator and delegates the execution to the DigitalOcean provider instance.
    @mcp.tool()
    def power_on_digitalocean_droplet(
        droplet_id: int, 
        ip_confirmation: str = "", 
        name_confirmation: str = "", 
        operation_confirmation: str = ""
    ) -> Dict:
        """
        开启DigitalOcean Droplet(需要三次确认)
        
        Args:
            droplet_id (int): Droplet ID
            ip_confirmation (str): 确认IP地址
            name_confirmation (str): 确认Droplet名称
            operation_confirmation (str): 确认操作类型(输入"开机"或"power_on")
            
        Returns:
            Dict: 操作结果或确认要求
        """
        return digitalocean_provider.power_on_droplet(
            droplet_id, ip_confirmation, name_confirmation, operation_confirmation
        )
  • Helper method in DigitalOceanProvider class that handles the power-on logic by calling the shared _execute_power_operation with 'power_on' action.
    def power_on_droplet(
        self, 
        droplet_id: int, 
        ip_confirmation: str = "", 
        name_confirmation: str = "", 
        operation_confirmation: str = ""
    ) -> Dict:
        """
        开启Droplet(需要三次确认)
        
        Args:
            droplet_id (int): Droplet ID
            ip_confirmation (str): IP地址确认
            name_confirmation (str): 名称确认
            operation_confirmation (str): 操作确认
            
        Returns:
            Dict: 操作结果或确认要求
        """
        return self._execute_power_operation(
            droplet_id, 'power_on', ip_confirmation, name_confirmation, operation_confirmation
        )
  • Core helper function that performs security triple confirmation, validates inputs, and executes the DigitalOcean API call to power on the droplet via droplet_actions.post.
    def _execute_power_operation(
        self, 
        droplet_id: int, 
        operation: str, 
        ip_confirmation: str, 
        name_confirmation: str, 
        operation_confirmation: str
    ) -> Dict:
        """
        执行电源操作的通用函数
        """
        if not self.available:
            return {
                'error': f'DigitalOcean服务不可用: {getattr(self, "error", "未知错误")}',
                'provider': 'digitalocean'
            }
        
        # 首先获取droplet信息
        try:
            droplet_response = self.client.droplets.get(droplet_id)
            droplet = droplet_response.get("droplet", {})
            
            if not droplet:
                return {
                    'error': f'未找到ID为 {droplet_id} 的Droplet',
                    'provider': 'digitalocean'
                }
            
            # 格式化droplet信息用于确认
            droplet_info = self._format_droplet_for_confirmation(droplet)
            
        except Exception as e:
            return {
                'error': f'获取Droplet信息时发生错误: {str(e)}',
                'provider': 'digitalocean'
            }
        
        # 检查是否提供了确认信息
        if not ip_confirmation or not name_confirmation or not operation_confirmation:
            # 返回确认要求
            return require_triple_confirmation(droplet_info, operation)
        
        # 验证确认信息
        security = SecurityConfirmation()
        is_valid, error_message = security.validate_power_operation(
            droplet_info, operation, ip_confirmation, name_confirmation, operation_confirmation
        )
        
        if not is_valid:
            return {
                'error': f'确认验证失败: {error_message}',
                'provider': 'digitalocean',
                'requires_confirmation': True
            }
        
        # 执行实际操作
        try:
            action_data = {"type": operation}
            response = self.client.droplet_actions.post(droplet_id=droplet_id, body=action_data)
            
            action = response.get("action", {})
            
            return {
                'provider': 'digitalocean',
                'droplet_id': droplet_id,
                'operation_success': True,
                'action': {
                    'id': action.get("id"),
                    'status': action.get("status"),
                    'type': action.get("type"),
                    'started_at': action.get("started_at"),
                    'resource_id': action.get("resource_id")
                },
                'message': f'已成功提交 {operation} 操作,操作ID: {action.get("id")}',
                'confirmation_validated': True
            }
            
        except Exception as e:
            return {
                'error': f'执行 {operation} 操作时发生错误: {str(e)}',
                'provider': 'digitalocean'
            }
Behavior4/5

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

With no annotations provided, the description carries full burden. It effectively discloses the critical behavioral trait of requiring three confirmations (IP, name, and operation type), which is essential for understanding this tool's safety mechanism. It also mentions the return type ('Dict: 操作结果或确认要求' - operation result or confirmation request), adding useful context about possible outcomes.

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

Conciseness4/5

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

The description is well-structured with clear sections (Args, Returns) and uses minimal but effective language. Every sentence earns its place by providing essential information. The only minor improvement could be making the purpose statement more prominent rather than embedding it in the first line.

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

Completeness4/5

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

Given this is a mutation tool with no annotations but with an output schema, the description provides good coverage. It explains the confirmation requirements, documents all parameters thoroughly, and mentions the return type. The main gap is lack of information about authentication requirements or error conditions, but the output schema likely covers return values adequately.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter documentation. It explains all four parameters: droplet_id, ip_confirmation, name_confirmation, and operation_confirmation with their purposes and even specifies acceptable values for operation_confirmation ('输入"开机"或"power_on"' - enter '开机' or 'power_on'). This adds significant value beyond the bare schema.

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 clearly states the action ('开启' meaning 'power on') and the resource ('DigitalOcean Droplet'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'power_on_alibaba_instance' or 'power_on_vultr_instance' beyond mentioning DigitalOcean specifically.

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

Usage Guidelines3/5

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

The description implies usage through the phrase '需要三次确认' (requires three confirmations), suggesting this tool should be used when extra caution is needed. However, it doesn't provide explicit guidance on when to choose this over alternatives like 'manage_instance_power' or other power-on tools for different providers.

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