Skip to main content
Glama
hostinger

hostinger-api-mcp

Official

hosting_listJsDeployments

Retrieve a paginated list of Node.js application deployments with optional filtering by deployment states to monitor their status.

Instructions

List javascript application deployments for checking their status. Use this tool when customer asks for the status of the deployment. This tool retrieves a paginated list of Node.js application deployments for a domain with optional filtering by deployment states.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name associated with the hosting account (e.g., example.com)
pageNoPage number for pagination (optional)
perPageNoNumber of items per page (optional)
statesNoFilter by deployment states (optional). Valid values: pending, completed, running, failed

Implementation Reference

  • Schema definition for the hosting_listJsDeployments tool. Defines input parameters (domain required, page/perPage optional integers, states optional filter array with enum values: pending, completed, running, failed). Marks it as a custom tool with handlerMethod 'handleListJavascriptDeployments'.
    {
      "name": "hosting_listJsDeployments",
      "topic": "hosting",
      "description": "List javascript application deployments for checking their status. Use this tool when customer asks for the status of the deployment. This tool retrieves a paginated list of Node.js application deployments for a domain with optional filtering by deployment states.",
      "method": "",
      "path": "",
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Domain name associated with the hosting account (e.g., example.com)"
          },
          "page": {
            "type": "integer",
            "description": "Page number for pagination (optional)"
          },
          "perPage": {
            "type": "integer",
            "description": "Number of items per page (optional)"
          },
          "states": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "running",
                "failed"
              ]
            },
            "description": "Filter by deployment states (optional). Valid values: pending, completed, running, failed"
          }
        },
        "required": [
          "domain"
        ]
      },
      "security": [],
      "custom": true,
      "templateFile": "list-javascript-deployments.template.js",
      "templateFileTS": "list-javascript-deployments.template.ts",
      "handlerMethod": "handleListJavascriptDeployments",
      "group": "hosting"
    },
  • Registration of the hosting_listJsDeployments tool in the executeCustomTool switch statement. When the tool name matches, it calls handleListJavascriptDeployments.
        case 'hosting_listJsDeployments':
          return await this.handleListJavascriptDeployments(params);
        case 'hosting_showJsDeploymentLogs':
          return await this.handleShowJsDeploymentLogs(params);
        default:
          throw new Error(`Unknown custom tool: ${tool.name}`);
      }
    }
  • Main handler function handleListJavascriptDeployments. Validates params, resolves username from domain, builds query params from optional filters (page, perPage, states), calls the API to fetch deployments from '/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds', and returns the result.
    async handleListJavascriptDeployments(params) {
      const { domain, page, perPage, states } = params;
    
      this.hosting_listJsDeployments_validateRequiredParams(params);
    
      // Auto-resolve username from domain
      this.log('info', `Resolving username from domain: ${domain}`);
      const username = await this.resolveUsername(domain);
    
      // Build query parameters
      const queryParams = this.hosting_listJsDeployments_buildQueryParams(params);
    
      // Fetch deployments
      let deployments;
      try {
        this.log('info', `Fetching deployments for ${domain}`);
        deployments = await this.hosting_listJsDeployments_fetchDeployments(username, domain, queryParams);
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        this.log('error', `Failed to fetch deployments: ${errorMessage}`);
        throw error;
      }
    
      return {
        status: 'success',
        domain,
        username,
        queryParams: {
          page,
          perPage,
          states
        },
        deployments
      };
    }
  • Helper function that builds URL query parameters for the deployments API call. Converts optional page, perPage, and states filters into query string format (page, per_page, states[]).
    hosting_listJsDeployments_buildQueryParams(params) {
      const { page, perPage, states } = params;
      const queryParams = new URLSearchParams();
    
      if (page !== undefined && page !== null) {
        queryParams.append('page', page.toString());
      }
    
      if (perPage !== undefined && perPage !== null) {
        queryParams.append('per_page', perPage.toString());
      }
    
      if (states && Array.isArray(states) && states.length > 0) {
        states.forEach(state => {
          queryParams.append('states[]', state);
        });
      }
    
      return queryParams.toString();
    }
  • Helper function that validates the required 'domain' parameter is present and is a string.
    hosting_listJsDeployments_validateRequiredParams(params) {
      const { domain } = params;
    
      if (!domain || typeof domain !== 'string') {
        throw new Error('domain is required and must be a string');
      }
    }
Behavior3/5

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

No annotations provided, so the description must carry the full burden. It discloses pagination and filtering but does not explicitly state read-only nature or what happens on failure. For a list operation, this 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?

Three sentences, each adding value: purpose, usage hint, and details. No redundant information. Front-loaded with the core action.

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?

The tool returns a paginated list, but the description does not specify what fields each deployment object contains. Given no output schema, the agent lacks information about the structure of the response, which may be insufficient for complete context.

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?

Schema coverage is 100%, so baseline is 3. Description adds value by specifying 'Node.js application deployments' and explicitly calling out the purpose of checking status, which aids understanding beyond bare parameter descriptions.

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?

Clearly states it lists JS deployments for checking status, distinguishing from deploy and log tools. The verb 'list' and resource 'JavaScript application deployments' are specific and unambiguous.

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?

Explicitly says to use when customer asks for deployment status. Mentions optional filtering by states. Does not explicitly mention alternatives, but context is 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