Skip to main content
Glama
hostinger

hostinger-api-mcp

Official

VPS_stopRecoveryModeV1

Exit system rescue mode for a virtual machine and return it to normal operation. Use when the VPS is in recovery mode and needs to be restored.

Instructions

Stop recovery mode for a specified virtual machine.

If virtual machine is not in recovery mode, this operation will fail.

Use this endpoint to exit system rescue mode and return VPS to normal operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
virtualMachineIdYesVirtual Machine ID

Implementation Reference

  • The executeApiCall method handles all non-custom tool executions including VPS_stopRecoveryModeV1. It performs the HTTP DELETE request to /api/vps/v1/virtual-machines/{virtualMachineId}/recovery with the virtualMachineId passed as a path parameter.
    async executeApiCall(tool, params) {
      // Get method and path from tool
      const method = tool.method;
      let path = tool.path;
    
      // Clone params to avoid modifying the original
      const requestParams = { ...params };
    
      // Replace path parameters with values from params
      Object.entries(requestParams).forEach(([key, value]) => {
        const placeholder = `{${key}}`;
        if (path.includes(placeholder)) {
          path = path.replace(placeholder, encodeURIComponent(String(value)));
          delete requestParams[key]; // Remove used parameter
        }
      });
    
      // Build the full URL
      const baseUrl = this.baseUrl.endsWith("/") ? this.baseUrl : `${this.baseUrl}/`;
      const cleanPath = path.startsWith("/") ? path.slice(1) : path;
      const url = new URL(cleanPath, baseUrl).toString();
    
      this.log('debug', `API Request: ${method} ${url}`);
    
      try {
        // Configure the request
        const config = {
          method: method.toLowerCase(),
          url,
          headers: { ...this.headers },
          timeout: 60000, // 60s
          validateStatus: function (status) {
            return status < 500; // Resolve only if the status code is less than 500
          }
        };
      
        const bearerToken = process.env['API_TOKEN'] || process.env['APITOKEN']; // APITOKEN for backwards compatibility
        if (bearerToken) {
          config.headers['Authorization'] = `Bearer ${bearerToken}`;
        } else {
          this.log('error', `Bearer Token environment variable not found: API_TOKEN`);
        }
    
        // Add parameters based on request method
        if (["GET", "DELETE"].includes(method)) {
          // For GET/DELETE, send params as query string
          config.params = { ...(config.params || {}), ...requestParams };
        } else {
          // For POST/PUT/PATCH, send params as JSON body
          config.data = requestParams;
          config.headers["Content-Type"] = "application/json";
        }
    
        this.log('debug', "Request config:", {
          url: config.url,
          method: config.method,
          params: config.params,
          headers: Object.keys(config.headers)
        });
    
        // Execute the request
        const response = await axios(config);
        this.log('debug', `Response status: ${response.status}`);
    
        return response.data;
    
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        this.log('error', `API request failed: ${errorMessage}`);
    
        if (axios.isAxiosError(error)) {
          const responseData = error.response?.data;
          const responseStatus = error.response?.status;
    
          this.log('error', 'API Error Details:', {
            status: responseStatus,
            data: typeof responseData === 'object' ? JSON.stringify(responseData) : responseData
          });
    
          // Rethrow with more context for better error handling
          const detailedError = new Error(`API request failed with status ${responseStatus}: ${errorMessage}`);
          detailedError.response = error.response;
          throw detailedError;
        }
    
        throw error;
      }
    }
    
    /**
     * Log messages with appropriate level
     * Only sends to MCP if we're connected
     */
    log(level, message, data) {
      // Always log to stderr for visibility
      console.error(`[${level.toUpperCase()}] ${message}${data ? ': ' + JSON.stringify(data) : ''}`);
    
      // Only try to send via MCP if we're in debug mode or it's important
      if (this.debug || level !== 'debug') {
        try {
          // Only send if server exists and is connected
          if (this.server && this.server.isConnected) {
            this.server.sendLoggingMessage({
              level,
              data: `[MCP Server] ${message}${data ? ': ' + JSON.stringify(data) : ''}`
            });
          }
        } catch (e) {
          // If logging fails, log to stderr
          console.error('Failed to send log via MCP:', e.message);
        }
      }
    }
    
    /**
     * Create and configure Express app with shared middleware
     */
    createApp() {
      const app = express();
      app.use(express.json());
      app.use(cors());
  • Input schema and tool definition for VPS_stopRecoveryModeV1. Defines a DELETE operation on /api/vps/v1/virtual-machines/{virtualMachineId}/recovery requiring only virtualMachineId (integer).
    {
      "name": "VPS_stopRecoveryModeV1",
      "description": "Stop recovery mode for a specified virtual machine.\n\nIf virtual machine is not in recovery mode, this operation will fail.\n\nUse this endpoint to exit system rescue mode and return VPS to normal operation.",
      "method": "DELETE",
      "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery",
      "inputSchema": {
        "type": "object",
        "properties": {
          "virtualMachineId": {
            "type": "integer",
            "description": "Virtual Machine ID"
          }
        },
        "required": [
          "virtualMachineId"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
  • TypeScript type definition for VPS_stopRecoveryModeV1 with typed OpenApiTool interface. Same schema definition as the JS file but with TypeScript type safety.
    {
      "name": "VPS_stopRecoveryModeV1",
      "description": "Stop recovery mode for a specified virtual machine.\n\nIf virtual machine is not in recovery mode, this operation will fail.\n\nUse this endpoint to exit system rescue mode and return VPS to normal operation.",
      "method": "DELETE",
      "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery",
      "inputSchema": {
        "type": "object",
        "properties": {
          "virtualMachineId": {
            "type": "integer",
            "description": "Virtual Machine ID"
          }
        },
        "required": [
          "virtualMachineId"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
  • src/servers/vps.js:1-6 (registration)
    Server entry point that imports tools (including VPS_stopRecoveryModeV1) from the vps.js tool definitions and passes them to startServer for registration with the MCP framework.
    #!/usr/bin/env node
    // Auto-generated entry for group: vps
    import { startServer } from '../core/runtime.js';
    import tools from '../core/tools/vps.js';
    
    startServer({ name: 'hostinger-vps-mcp', version: '0.1.41', tools });
  • src/servers/vps.ts:1-6 (registration)
    TypeScript server entry point that imports tools (including VPS_stopRecoveryModeV1) and registers them with the MCP framework.
    #!/usr/bin/env node
    // Auto-generated entry for group: vps
    import { startServer } from '../core/runtime.js';
    import tools from '../core/tools/vps.js';
    
    startServer({ name: 'hostinger-vps-mcp', version: '0.1.41', tools });
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It discloses that the operation will fail if the VM is not in recovery mode, which is a key behavioral trait. However, it does not mention other behaviors such as side effects, authentication requirements, or rate limits. The given information is adequate but minimal.

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 very concise with only three sentences: purpose, condition, and usage guidance. Every sentence provides unique value without redundancy or unnecessary details.

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 the tool's simplicity (one parameter, no output schema), the description adequately covers the purpose, a critical precondition, and the intended effect. It could mention the success response (e.g., returns nothing), but that is not required. Overall, it is sufficiently complete for an agent to understand and use the tool correctly.

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

Parameters3/5

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

The input schema has 100% description coverage (virtualMachineId described as 'Virtual Machine ID'). The description does not add any additional meaning or context about the parameter beyond the schema. Baseline score of 3 applies.

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

Purpose5/5

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

The description clearly states the verb 'stop' and the resource 'recovery mode for a specified virtual machine.' It distinguishes itself from the sibling VPS_startRecoveryModeV1 by using the opposite verb.

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

Usage Guidelines4/5

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

The description specifies a condition ('If virtual machine is not in recovery mode, this operation will fail') and indicates when to use ('exit system rescue mode'). It does not explicitly compare with alternatives like startRecoveryModeV1, but the context is clear enough.

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/hostinger/api-mcp-server'

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