Skip to main content
Glama
hostinger

hostinger-api-mcp

Official

VPS_createNewFirewallV1

Create a new firewall configuration for VPS security. Specify a name to define the rule set.

Instructions

Create a new firewall.

Use this endpoint to set up new firewall configurations for VPS security.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesname parameter

Implementation Reference

  • Tool registration definition for VPS_createNewFirewallV1. It is an auto-generated tool entry that declares the tool's name, description, HTTP method (POST), API path (/api/vps/v1/firewall), input schema (requires a 'name' string), and security configuration.
    {
      "name": "VPS_createNewFirewallV1",
      "description": "Create a new firewall.\n\nUse this endpoint to set up new firewall configurations for VPS security.",
      "method": "POST",
      "path": "/api/vps/v1/firewall",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "name parameter"
          }
        },
        "required": [
          "name"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
  • TypeScript type-definition counterpart of the tool registration for VPS_createNewFirewallV1. Same structure as the JS file, providing type information via the OpenApiTool interface.
    {
      "name": "VPS_createNewFirewallV1",
      "description": "Create a new firewall.\n\nUse this endpoint to set up new firewall configurations for VPS security.",
      "method": "POST",
      "path": "/api/vps/v1/firewall",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "name parameter"
          }
        },
        "required": [
          "name"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
  • Input schema for VPS_createNewFirewallV1. The tool accepts a single required parameter 'name' (string).
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "name parameter"
          }
        },
        "required": [
          "name"
        ]
      },
      "security": [
        {
          "apiToken": []
        }
      ],
      "group": "vps"
    },
    {
      "name": "VPS_updateFirewallRuleV1",
      "description": "Update a specific firewall rule from a specified firewall.\n\nAny virtual machine that has this firewall activated will lose sync with the firewall\nand will have to be synced again manually.\n\nUse this endpoint to modify existing firewall rules.",
  • Generic API call executor used for all non-custom tools including VPS_createNewFirewallV1. Since VPS_createNewFirewallV1 has no custom flag, it uses this executeApiCall method which: extracts method (POST) and path (/api/vps/v1/firewall), replaces path parameters, adds auth token, and sends the request via axios. The 'name' parameter is sent as JSON body since the method is POST.
    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?

With no annotations, the description bears full responsibility for behavioral disclosure. It only states it creates a firewall but does not mention if the operation is safe (e.g., non-destructive), authentication requirements, rate limits, or what state the firewall is in after creation (e.g., inactive).

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 concise with two short sentences that clearly convey the core purpose without any extraneous information. It is front-loaded and every word earns its place.

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

Completeness2/5

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

Despite the simplicity of the tool (one parameter, no output schema), the description lacks completeness. It does not explain what happens after creation, e.g., whether the firewall is active, how to retrieve the created firewall's ID, or that it can be later configured with rules. The context for using this tool in a workflow is missing.

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

Parameters2/5

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

The input schema shows one parameter 'name' with description 'name parameter', which is minimal. The tool description adds no additional meaning beyond the schema, such as naming conventions or uniqueness constraints. Schema coverage is 100% but the description fails to enrich the parameter semantics.

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 'Create a new firewall' and 'set up new firewall configurations', providing a specific verb and resource. However, it does not differentiate from sibling tools like VPS_activateFirewallV1 or VPS_createFirewallRuleV1, but the name itself is clear enough.

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?

No guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing to activate the firewall after creation, or that it pairs with VPS_createFirewallRuleV1. The description is silent on usage context.

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