Skip to main content
Glama

deploy_project

Deploy a project using its .ploi.json configuration file and wait for completion. Use this when the user says 'deploy' without specifying a site.

Instructions

Deploy the current project using .ploi.json config file and wait for completion. Use this when the user says 'deploy' without specifying a site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesThe path to the project directory containing .ploi.json

Implementation Reference

  • The tool registration entry point - registerSiteTools is called from registerAllTools which is invoked from main().
    import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import type { PloiClient } from "../client.js";
    import { registerServerTools } from "./servers.js";
    import { registerSiteTools } from "./sites.js";
    import { registerDatabaseTools } from "./databases.js";
    
    export function registerAllTools(server: McpServer, client: PloiClient) {
      registerServerTools(server, client);
      registerSiteTools(server, client);
      registerDatabaseTools(server, client);
    }
  • The 'deploy_project' tool is registered via server.tool() with name 'deploy_project', description, Zod schema (project_path), and async handler.
    server.tool(
      "deploy_project",
      "Deploy the current project using .ploi.json config file and wait for completion. Use this when the user says 'deploy' without specifying a site.",
      {
        project_path: z.string().describe("The path to the project directory containing .ploi.json"),
      },
      async ({ project_path }) => {
        const config = await readPloiConfig(project_path);
        if (!config) {
          return {
            content: [
              {
                type: "text" as const,
                text: `No .ploi.json config found in ${project_path}. Create one with:\n{\n  "server_id": YOUR_SERVER_ID,\n  "site_id": YOUR_SITE_ID\n}\n\nOr use: "link this project to yourdomain.com"`,
              },
            ],
          };
        }
    
        const initialSite = await client.getSite(config.server_id, config.site_id);
        await client.deploySite(config.server_id, config.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(config.server_id, config.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") {
            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 for ${initialSite.domain}. Check status manually.`,
            },
          ],
        };
      }
    );
  • Input schema defines a single required parameter: project_path (string) described as 'The path to the project directory containing .ploi.json'.
    {
      project_path: z.string().describe("The path to the project directory containing .ploi.json"),
    },
  • Handler reads .ploi.json config, triggers deploy via client.deploySite(), then polls getSite() every 5 seconds up to 60 attempts (5 min), returning success/error/timeout messages.
    async ({ project_path }) => {
      const config = await readPloiConfig(project_path);
      if (!config) {
        return {
          content: [
            {
              type: "text" as const,
              text: `No .ploi.json config found in ${project_path}. Create one with:\n{\n  "server_id": YOUR_SERVER_ID,\n  "site_id": YOUR_SITE_ID\n}\n\nOr use: "link this project to yourdomain.com"`,
            },
          ],
        };
      }
    
      const initialSite = await client.getSite(config.server_id, config.site_id);
      await client.deploySite(config.server_id, config.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(config.server_id, config.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") {
          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 for ${initialSite.domain}. Check status manually.`,
          },
        ],
      };
    }
  • Helper function readPloiConfig() reads and parses .ploi.json from project_path, returning {server_id, site_id} or null.
    async function readPloiConfig(projectPath: string): Promise<PloiConfig | null> {
      try {
        const configPath = join(projectPath, ".ploi.json");
        const content = await readFile(configPath, "utf-8");
        const config = JSON.parse(content) as PloiConfig;
        if (typeof config.server_id === "number" && typeof config.site_id === "number") {
          return config;
        }
        return null;
      } catch {
        return null;
      }
    }
Behavior2/5

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

No annotations are provided, so the description alone must disclose behavioral traits. It mentions 'wait for completion', indicating synchronous behavior, but omits side effects, permission requirements, or cancellation possibilities. More detail is needed for a deployment action.

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 two sentences: one explaining the core action and a second providing usage guidance. Every sentence adds value, and the structure is front-loaded with the purpose.

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?

Given the tool has only one parameter, no output schema, and no annotations, the description is fairly complete for basic understanding. It explains what it does and when to use it, but it lacks details on return values, failure modes, or prerequisites.

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 one parameter with a description that fully explains its purpose. The tool description does not add additional meaning beyond the schema, so a baseline score 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 action ('deploy'), the resource ('project using .ploi.json config file'), and a key behavioral detail (wait for completion). It differentiates from siblings by specifying use case: 'when the user says deploy without specifying a site', contrasting with deploy_site.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'Use this when the user says deploy without specifying a site.', implying that deploy_site is for when a site is specified. This provides clear usage guidance and differentiates from siblings.

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