Skip to main content
Glama

deploy_site

Trigger deployment for a specified site on a Ploi server and wait for it to complete. Returns the final status of the deployment.

Instructions

Trigger deployment for a site and wait for it to complete. Returns status when done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesThe ID of the server
site_idYesThe ID of the site to deploy

Implementation Reference

  • MCP tool handler for 'deploy_site'. Calls client.deploySite() then polls every 5s for up to 5 minutes until site status is 'active' or changes from 'deploying'. Returns a formatted status message.
    server.tool(
      "deploy_site",
      "Trigger deployment for a site and wait for it to complete. Returns status when done.",
      {
        server_id: z.coerce.number().describe("The ID of the server"),
        site_id: z.coerce.number().describe("The ID of the site to deploy"),
      },
      async ({ server_id, site_id }) => {
        await client.deploySite(server_id, site_id);
    
        // Poll until deployment completes (max 5 minutes)
        const maxAttempts = 60;
        const pollInterval = 5000; // 5 seconds
    
        for (let attempt = 0; attempt < maxAttempts; attempt++) {
          await new Promise(resolve => setTimeout(resolve, pollInterval));
    
          const site = await client.getSite(server_id, site_id);
    
          if (site.status === "active") {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `✅ Deployment successful!\n\nSite: ${site.domain}\nStatus: ${site.status}`,
                },
              ],
            };
          }
    
          if (site.status !== "deploying") {
            // Some other status (error, etc)
            return {
              content: [
                {
                  type: "text" as const,
                  text: `⚠️ Deployment ended with status: ${site.status}\n\nSite: ${site.domain}`,
                },
              ],
            };
          }
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: `⏱️ Deployment still in progress after 5 minutes. Check status manually.`,
            },
          ],
        };
      }
  • Zod schema for deploy_site: requires server_id and site_id as numbers.
    {
      server_id: z.coerce.number().describe("The ID of the server"),
      site_id: z.coerce.number().describe("The ID of the site to deploy"),
    },
  • Tool registration via server.tool('deploy_site', ...) inside registerSiteTools() which is called from registerAllTools().
    server.tool(
      "deploy_site",
      "Trigger deployment for a site and wait for it to complete. Returns status when done.",
      {
        server_id: z.coerce.number().describe("The ID of the server"),
        site_id: z.coerce.number().describe("The ID of the site to deploy"),
      },
      async ({ server_id, site_id }) => {
        await client.deploySite(server_id, site_id);
    
        // Poll until deployment completes (max 5 minutes)
        const maxAttempts = 60;
        const pollInterval = 5000; // 5 seconds
    
        for (let attempt = 0; attempt < maxAttempts; attempt++) {
          await new Promise(resolve => setTimeout(resolve, pollInterval));
    
          const site = await client.getSite(server_id, site_id);
    
          if (site.status === "active") {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `✅ Deployment successful!\n\nSite: ${site.domain}\nStatus: ${site.status}`,
                },
              ],
            };
          }
    
          if (site.status !== "deploying") {
            // Some other status (error, etc)
            return {
              content: [
                {
                  type: "text" as const,
                  text: `⚠️ Deployment ended with status: ${site.status}\n\nSite: ${site.domain}`,
                },
              ],
            };
          }
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: `⏱️ Deployment still in progress after 5 minutes. Check status manually.`,
            },
          ],
        };
      }
    );
  • PloiClient.deploySite() - HTTP helper that POSTs to /servers/{serverId}/sites/{siteId}/deploy to trigger a deployment.
    async deploySite(serverId: number, siteId: number): Promise<void> {
      await this.request<void>(
        "POST",
        `/servers/${serverId}/sites/${siteId}/deploy`
      );
    }
Behavior3/5

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

With no annotations, the description bears the full burden. It discloses the blocking/waiting behavior and return of status, which is valuable. However, it omits potential side effects, permissions, or rate limits, leaving gaps.

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?

Two sentences, no wasted words, and the most critical information (trigger and wait) is front-loaded. Highly concise and well-structured.

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 (2 params, no output schema), the description adequately covers the action. It mentions waiting and status return, though it could be more explicit about what the status contains. Minor gap.

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?

Schema coverage is 100%, so parameters are already documented. The description adds no extra meaning beyond what the schema provides, hitting the baseline of 3.

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 tool triggers a deployment for a site and waits for completion, returning status. This distinguishes it from siblings like deploy_project (different resource) and get_project_deploy_status (status checking).

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 the tool is for triggering and waiting for a deployment, but provides no explicit guidance on when to use it versus alternatives like deploy_project or get_project_deploy_status, nor does it state when not to use it.

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/sudanese/ploi-mcp'

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