Skip to main content
Glama
hostinger

hostinger-api-mcp

Official

VPS_getProjectContainersV1

Lists all containers in a Docker Compose project on a virtual machine, providing their status, port mappings, and runtime configuration for monitoring service health.

Instructions

Retrieves a list of all containers belonging to a specific Docker Compose project on the virtual machine.

This endpoint returns detailed information about each container including their current status, port mappings, and runtime configuration.

Use this to monitor the health and state of all services within your Docker Compose project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
virtualMachineIdYesVirtual Machine ID
projectNameYesDocker Compose project name using alphanumeric characters, dashes, and underscores only

Implementation Reference

  • Input schema and tool definition for VPS_getProjectContainersV1. Defines it as a GET request to /api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/containers with required parameters: virtualMachineId (integer) and projectName (string).
    {
      "name": "VPS_getProjectContainersV1",
      "description": "Retrieves a list of all containers belonging to a specific Docker Compose project on the virtual machine. \n\nThis endpoint returns detailed information about each container including\ntheir current status, port mappings, and runtime configuration.\n\nUse this to monitor the health and state of all services within your Docker Compose project.",
      "method": "GET",
      "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/containers",
      "inputSchema": {
        "type": "object",
        "properties": {
          "virtualMachineId": {
            "type": "integer",
            "description": "Virtual Machine ID"
          },
          "projectName": {
            "type": "string",
            "description": "Docker Compose project name using alphanumeric characters, dashes, and underscores only"
          }
        },
        "required": [
          "virtualMachineId",
          "projectName"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
  • Input schema and tool definition (JS version) for VPS_getProjectContainersV1. Identical definition to the TS file.
    {
      "name": "VPS_getProjectContainersV1",
      "description": "Retrieves a list of all containers belonging to a specific Docker Compose project on the virtual machine. \n\nThis endpoint returns detailed information about each container including\ntheir current status, port mappings, and runtime configuration.\n\nUse this to monitor the health and state of all services within your Docker Compose project.",
      "method": "GET",
      "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/containers",
      "inputSchema": {
        "type": "object",
        "properties": {
          "virtualMachineId": {
            "type": "integer",
            "description": "Virtual Machine ID"
          },
          "projectName": {
            "type": "string",
            "description": "Docker Compose project name using alphanumeric characters, dashes, and underscores only"
          }
        },
        "required": [
          "virtualMachineId",
          "projectName"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
  • src/servers/vps.js:3-6 (registration)
    Entry point that registers all VPS tools (including VPS_getProjectContainersV1) with the MCP server by importing the tool list and passing it to startServer.
    import { startServer } from '../core/runtime.js';
    import tools from '../core/tools/vps.js';
    
    startServer({ name: 'hostinger-vps-mcp', version: '0.1.41', tools });
  • Generic API call executor used for VPS_getProjectContainersV1. Since this tool is not 'custom', it uses executeApiCall which substitutes path parameters ({virtualMachineId}, {projectName}) from input params and makes a GET request to the Hostinger API.
    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;
      }
    }
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It only states the return content but does not disclose whether the operation is read-only, any required permissions, potential errors (e.g., if the project does not exist), or side effects. The description does not contradict annotations, but fails to provide sufficient behavioral context.

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 composed of three sentences that are front-loaded with the main purpose, followed by detail and usage guidance. It is efficient, with no redundant or extraneous content.

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?

For a simple read operation with two well-described parameters and no output schema, the description provides the essential purpose and return value details. It lacks specifics on pagination, error handling, or an example, but is generally sufficient given the tool's straightforward nature.

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 schema covers 100% of parameters with descriptions. The tool description does not add extra meaning beyond reiterating 'belonging to a specific Docker Compose project', which is already implied by the parameter names. With high schema coverage, a baseline of 3 is appropriate.

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 (retrieves), resource (containers), and scope (specific Docker Compose project on a virtual machine). It also mentions the detailed information returned (status, port mappings, runtime configuration), which distinguishes it from other VPS tools like getProjectListV1 or getProjectContentsV1.

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 explicitly suggests using this tool to 'monitor the health and state of all services within your Docker Compose project', providing a clear use case. However, it does not mention when not to use it or compare to alternative tools like getProjectLogsV1, though the context makes the intent reasonably clear.

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