get_deployment_status
Check deployment status and health by providing a deployment ID to monitor metrics and ensure operational integrity.
Instructions
Check the status and health of a deployment.
Args: deployment_id: The deployment identifier (e.g., 'vr-20240115-a1b2c3d4')
Returns: Current deployment status including health checks and metrics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_id | Yes |
Implementation Reference
- The implementation of the get_deployment_status MCP tool. It validates the deployment ID, attempts to retrieve the status using DockerDeployer and then BinaryDeployer, performs a health check, and returns the combined results.
async def get_deployment_status( deployment_id: str, ) -> list[TextContent]: """Check the status and health of a deployment. Args: deployment_id: The deployment identifier (e.g., 'vr-20240115-a1b2c3d4') Returns: Current deployment status including health checks and metrics. """ try: # Validate deployment_id deployment_id = validate_deployment_id(deployment_id) from ..deployment.deployers import DockerDeployer, BinaryDeployer # Try Docker first deployer = DockerDeployer() info = await deployer.get_status(deployment_id) if info: health = await deployer.health_check(deployment_id) return [TextContent( type="text", text=json.dumps({ **info.to_dict(), "health": health, }, indent=2, default=str) )] # Try binary deployer deployer = BinaryDeployer() info = await deployer.get_status(deployment_id) if info: health = await deployer.health_check(deployment_id) return [TextContent( type="text", text=json.dumps({ **info.to_dict(), "health": health, }, indent=2, default=str) )] return [TextContent( type="text", text=json.dumps({ "error": f"Deployment not found: {deployment_id}", "hint": "Use list_deployments tool to see available deployments" }, indent=2) )] except ValueError as e: # Validation errors return [TextContent( type="text", text=json.dumps({ "error": str(e), "hint": "Provide a valid deployment ID starting with 'vr-'" }, indent=2) )] 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": "Failed to get deployment status", "hint": "Check deployment ID and try again" }, indent=2) )]