Skip to main content
Glama

verify_deployment

Check GitHub Pages deployment status and identify issues by analyzing repository configuration and expected URL.

Instructions

Verify and troubleshoot GitHub Pages deployment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repositoryYesRepository path or URL
urlNoExpected deployment URL

Implementation Reference

  • The core handler function for the 'verify_deployment' tool. It validates input using the defined schema, performs checks for GitHub Actions workflow, documentation files, SSG configuration, build output, and deployment URL, then returns a formatted MCP response with status, summary, and recommendations.
    export async function verifyDeployment(
      args: unknown,
    ): Promise<{ content: any[] }> {
      const startTime = Date.now();
      const { repository, url } = inputSchema.parse(args);
    
      try {
        const checks: DeploymentCheck[] = [];
    
        // Determine repository path
        const repoPath = repository.startsWith("http") ? "." : repository;
    
        // Check 1: GitHub Actions workflow exists
        const workflowPath = path.join(repoPath, ".github", "workflows");
        try {
          const workflows = await fs.readdir(workflowPath);
          const deployWorkflow = workflows.find(
            (f) =>
              f.includes("deploy") || f.includes("pages") || f.includes("docs"),
          );
    
          if (deployWorkflow) {
            checks.push({
              check: "GitHub Actions Workflow",
              status: "pass",
              message: `Found deployment workflow: ${deployWorkflow}`,
            });
          } else {
            checks.push({
              check: "GitHub Actions Workflow",
              status: "fail",
              message: "No deployment workflow found",
              recommendation: "Run deploy_pages tool to create a workflow",
            });
          }
        } catch {
          checks.push({
            check: "GitHub Actions Workflow",
            status: "fail",
            message: "No .github/workflows directory found",
            recommendation: "Run deploy_pages tool to set up GitHub Actions",
          });
        }
    
        // Check 2: Documentation source files exist
        const docsPaths = ["docs", "documentation", "site", "content"];
        let docsFound = false;
    
        for (const docsPath of docsPaths) {
          try {
            const fullPath = path.join(repoPath, docsPath);
            const stats = await fs.stat(fullPath);
            if (stats.isDirectory()) {
              const files = await fs.readdir(fullPath);
              const mdFiles = files.filter(
                (f) => f.endsWith(".md") || f.endsWith(".mdx"),
              );
    
              if (mdFiles.length > 0) {
                docsFound = true;
                checks.push({
                  check: "Documentation Source Files",
                  status: "pass",
                  message: `Found ${mdFiles.length} documentation files in ${docsPath}/`,
                });
                break;
              }
            }
          } catch {
            // Directory doesn't exist, continue checking
          }
        }
    
        if (!docsFound) {
          checks.push({
            check: "Documentation Source Files",
            status: "warning",
            message: "No documentation files found in standard locations",
            recommendation:
              "Run setup_structure tool to create documentation structure",
          });
        }
    
        // Check 3: Configuration files
        const configPatterns = [
          "docusaurus.config.js",
          "mkdocs.yml",
          "hugo.toml",
          "hugo.yaml",
          "_config.yml",
          ".eleventy.js",
        ];
    
        let configFound = false;
        for (const config of configPatterns) {
          try {
            await fs.access(path.join(repoPath, config));
            configFound = true;
            checks.push({
              check: "SSG Configuration",
              status: "pass",
              message: `Found configuration file: ${config}`,
            });
            break;
          } catch {
            // File doesn't exist, continue
          }
        }
    
        if (!configFound) {
          checks.push({
            check: "SSG Configuration",
            status: "fail",
            message: "No static site generator configuration found",
            recommendation: "Run generate_config tool to create SSG configuration",
          });
        }
    
        // Check 4: Build output directory
        const buildDirs = ["_site", "build", "dist", "public", "out"];
        let buildFound = false;
    
        for (const buildDir of buildDirs) {
          try {
            const buildPath = path.join(repoPath, buildDir);
            const stats = await fs.stat(buildPath);
            if (stats.isDirectory()) {
              buildFound = true;
              checks.push({
                check: "Build Output",
                status: "pass",
                message: `Found build output directory: ${buildDir}/`,
              });
              break;
            }
          } catch {
            // Directory doesn't exist
          }
        }
    
        if (!buildFound) {
          checks.push({
            check: "Build Output",
            status: "warning",
            message: "No build output directory found",
            recommendation: "Run your SSG build command to generate the site",
          });
        }
    
        // Check 5: GitHub Pages settings (if URL provided)
        if (url) {
          checks.push({
            check: "Deployment URL",
            status: "warning",
            message: `Expected URL: ${url}`,
            recommendation: "Verify GitHub Pages is enabled in repository settings",
          });
        }
    
        // Generate summary
        const passCount = checks.filter((c) => c.status === "pass").length;
        const failCount = checks.filter((c) => c.status === "fail").length;
        const warningCount = checks.filter((c) => c.status === "warning").length;
    
        let overallStatus = "Ready for deployment";
        if (failCount > 0) {
          overallStatus = "Configuration required";
        } else if (warningCount > 0) {
          overallStatus = "Minor issues detected";
        }
    
        const verificationResult = {
          repository,
          url,
          overallStatus,
          checks,
          summary: {
            passed: passCount,
            warnings: warningCount,
            failed: failCount,
            total: checks.length,
          },
        };
    
        const response: MCPToolResponse<typeof verificationResult> = {
          success: true,
          data: verificationResult,
          metadata: {
            toolVersion: "1.0.0",
            executionTime: Date.now() - startTime,
            timestamp: new Date().toISOString(),
          },
          recommendations: [
            {
              type:
                failCount > 0 ? "critical" : warningCount > 0 ? "warning" : "info",
              title: "Deployment Verification Complete",
              description: `${overallStatus}. ${passCount} checks passed, ${warningCount} warnings, ${failCount} failures.`,
            },
          ],
          nextSteps: checks
            .filter((check) => check.recommendation)
            .map((check) => ({
              action: check.recommendation!,
              toolRequired: check.recommendation!.includes("deploy_pages")
                ? "deploy_pages"
                : check.recommendation!.includes("setup_structure")
                  ? "setup_structure"
                  : check.recommendation!.includes("generate_config")
                    ? "generate_config"
                    : "manual",
              description: check.message,
              priority: check.status === "fail" ? "high" : ("medium" as const),
            })),
        };
    
        return formatMCPResponse(response);
      } catch (error) {
        const errorResponse: MCPToolResponse = {
          success: false,
          error: {
            code: "VERIFICATION_FAILED",
            message: `Failed to verify deployment: ${error}`,
            resolution: "Ensure repository path is accessible",
          },
          metadata: {
            toolVersion: "1.0.0",
            executionTime: Date.now() - startTime,
            timestamp: new Date().toISOString(),
          },
        };
        return formatMCPResponse(errorResponse);
      }
    }
  • Zod schema for input validation: requires 'repository' string, optional 'url' string.
    const inputSchema = z.object({
      repository: z.string(),
      url: z.string().optional(),
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'verify and troubleshoot', implying read-only diagnostic operations, but doesn't specify if it requires authentication, has rate limits, returns detailed logs or errors, or affects the deployment state. For a tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

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 a single, efficient sentence that front-loads the core purpose ('verify and troubleshoot GitHub Pages deployment') with zero wasted words. It's appropriately sized for the tool's complexity and avoids redundancy.

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?

Given no annotations and no output schema, the description is incomplete for a tool that likely involves complex deployment diagnostics. It doesn't explain what 'verify' entails (e.g., checks for build errors, URL accessibility, content updates) or what 'troubleshoot' returns (e.g., error messages, status codes). For a tool with potential behavioral nuances, this leaves significant gaps.

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 description coverage is 100%, so the schema already documents both parameters ('repository' and 'url') adequately. The description adds no additional meaning beyond the schema, such as explaining how 'repository' paths are formatted or what 'verify' entails for the URL. Baseline 3 is appropriate when the schema does the heavy lifting.

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 the tool's purpose with specific verbs ('verify and troubleshoot') and resource ('GitHub Pages deployment'), making it distinct from siblings like 'deploy_pages' (which creates deployments) or 'test_local_deployment' (which tests locally). However, it doesn't explicitly differentiate from 'analyze_deployments' or 'validate_content', which could have overlapping scopes, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'deploy_pages', 'test_local_deployment', and 'analyze_deployments', it's unclear if this is for post-deployment checks, pre-deployment validation, or general monitoring. No exclusions or prerequisites are mentioned, leaving usage context ambiguous.

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/tosin2013/documcp'

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