Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

validate_deployment

Run security and health validation on deployments to check server accessibility, certificate validity, service health, and security configuration, returning detailed reports of any issues found.

Instructions

Run comprehensive security and health validation on a deployment.

Checks:

  • Server accessibility

  • Certificate validity

  • Service health

  • Security configuration

Args: deployment_id: The deployment to validate

Returns: Detailed validation report with any issues found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the `validate_deployment` tool, which runs security and health checks on a specific deployment.
    async def validate_deployment(
        deployment_id: str,
    ) -> list[TextContent]:
        """Run comprehensive security and health validation on a deployment.
    
        Checks:
        - Server accessibility
        - Certificate validity
        - Service health
        - Security configuration
    
        Args:
            deployment_id: The deployment to validate
    
        Returns:
            Detailed validation report with any issues found.
        """
        try:
            from ..deployment.security import CertificateManager
            from ..deployment.deployers import DockerDeployer
    
            checks = []
    
            # Check deployment exists
            deployer = DockerDeployer()
            info = await deployer.get_status(deployment_id)
    
            if not info:
                return [TextContent(
                    type="text",
                    text=json.dumps({
                        "valid": False,
                        "error": f"Deployment not found: {deployment_id}"
                    }, indent=2)
                )]
    
            checks.append({
                "check": "deployment_exists",
                "status": "pass",
                "message": f"Deployment found: {info.target}",
            })
    
            # Check certificates
            cert_manager = CertificateManager()
            bundle = cert_manager.load_bundle(deployment_id)
    
            if bundle:
                checks.append({
                    "check": "certificates_exist",
                    "status": "pass",
                    "message": f"CA fingerprint: {bundle.ca_fingerprint[:16]}...",
                })
            else:
                checks.append({
                    "check": "certificates_exist",
                    "status": "fail",
                    "message": "Certificate bundle not found",
                })
    
            # Check health
            health = await deployer.health_check(deployment_id)
            health_status = "pass" if health.get("healthy") else "fail"
            checks.append({
                "check": "health_check",
                "status": health_status,
                "message": health.get("checks", []),
            })
    
            # Check auto-destroy schedule
            if info.auto_destroy_at:
                destroy_time = datetime.fromisoformat(info.auto_destroy_at.replace("Z", "+00:00"))
                hours_remaining = (destroy_time - datetime.now(timezone.utc)).total_seconds() / 3600
    
                if hours_remaining < 0:
                    checks.append({
                        "check": "auto_destroy",
                        "status": "warn",
                        "message": f"Deployment scheduled for destruction has passed",
                    })
                elif hours_remaining < 24:
                    checks.append({
                        "check": "auto_destroy",
                        "status": "warn",
                        "message": f"Deployment will be destroyed in {hours_remaining:.1f} hours",
                    })
                else:
                    checks.append({
                        "check": "auto_destroy",
                        "status": "info",
                        "message": f"Deployment will be destroyed in {hours_remaining:.1f} hours",
                    })
    
            # Overall status
            failed_checks = [c for c in checks if c["status"] == "fail"]
            warn_checks = [c for c in checks if c["status"] == "warn"]
    
            return [TextContent(
                type="text",
                text=json.dumps({
                    "valid": len(failed_checks) == 0,
                    "deployment_id": deployment_id,
                    "state": info.state.value,
                    "summary": {
                        "passed": len([c for c in checks if c["status"] == "pass"]),
                        "warnings": len(warn_checks),
                        "failed": len(failed_checks),
                    },
                    "checks": checks,
                }, indent=2, default=str)
            )]
    
        except ImportError as e:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": f"Missing dependency: {str(e)}",
                    "hint": "Install required packages with: pip install megaraptor-mcp[deployment]"
                }, indent=2)
            )]
    
        except Exception:
            # Generic errors - don't expose internals
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "Operation failed",
                    "hint": "Check deployment configuration and try again"
                }, indent=2)
            )]
Behavior4/5

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

With no annotations provided, the description carries the full burden and successfully lists four specific behavioral aspects (accessibility, certificate, service health, security checks). It notes the return value is a validation report. Missing only safety confirmation (read-only nature) which would be critical for a security tool.

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?

Excellent structure with clear implicit sections (purpose, checks, args, returns). Front-loaded with the main action. No redundant words; the checklist format efficiently conveys validation scope without prose bloat.

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 single parameter (adequately documented in description despite 0% schema coverage) and existence of output schema, the description appropriately focuses on operational behavior. The return value description is sufficient since detailed schema exists separately. Could improve by noting if validation is safe to run repeatedly.

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 0% (no description field in JSON schema), but the description compensates by providing semantic meaning: 'deployment_id: The deployment to validate'. This clarifies the parameter's purpose beyond the schema's decorative title 'Deployment Id'.

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 runs 'comprehensive security and health validation' with specific checks listed (server accessibility, certificate validity, service health, security configuration). It effectively distinguishes from siblings like check_agent_deployment (agent-specific) and get_deployment_status (status retrieval) by emphasizing the comprehensive validation scope.

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?

While the description implies usage through the term 'comprehensive' and the detailed checklist, it lacks explicit guidance on when to use this versus check_agent_deployment or get_deployment_status. No prerequisites or exclusions are mentioned.

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/wagonbomb/megaraptor-mcp'

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