generate_environment_report
Generate a comprehensive As-Built report for your Nutanix environment, covering clusters, hosts, storage, networking, and VM inventory. Returns Markdown with an Excalidraw topology diagram.
Instructions
Generate a comprehensive As-Built report for the full Nutanix environment. Covers all clusters, hosts, storage, networking, and VM inventory registered with Prism Central. Returns Markdown with an Excalidraw topology diagram.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_vms | No | Include full VM inventory in the report (default: true) | |
| include_diagram | No | Include Excalidraw topology diagram JSON (default: true) |
Implementation Reference
- Tool definition (name, description, inputSchema) for generate_environment_report
REPORT_TOOLS: list[dict] = [ { "name": "generate_environment_report", "description": ( "Generate a comprehensive As-Built report for the full Nutanix environment. " "Covers all clusters, hosts, storage, networking, and VM inventory registered " "with Prism Central. Returns Markdown with an Excalidraw topology diagram." ), "inputSchema": { "type": "object", "properties": { "include_vms": { "type": "boolean", "description": "Include full VM inventory in the report (default: true)", "default": True, }, "include_diagram": { "type": "boolean", "description": "Include Excalidraw topology diagram JSON (default: true)", "default": True, }, }, }, }, - src/nutanix_mcp/tools/report.py:953-1038 (handler)Handler function that fetches clusters, hosts, containers, subnets, VMs, builds markdown report and optional Excalidraw diagram
async def handle_generate_environment_report( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """Generate full environment As-Built report.""" include_vms = arguments.get("include_vms", True) include_diagram = arguments.get("include_diagram", True) # Collect all environment data clusters_result = await client.v4_list( namespace="clustermgmt", path="config/clusters" ) clusters = clusters_result.get("data", []) # Get detailed info for each cluster detailed_clusters = [] hosts_by_cluster: dict[str, list[dict]] = {} for cluster in clusters: ext_id = cluster.get("extId", "") # Get full cluster details try: detail = await client.v4_get( namespace="clustermgmt", path=f"config/clusters/{ext_id}" ) detailed_clusters.append(detail.get("data", cluster)) except Exception: detailed_clusters.append(cluster) # Get hosts for this cluster try: hosts_result = await client.v4_list( namespace="clustermgmt", path=f"config/clusters/{ext_id}/hosts", ) hosts_by_cluster[ext_id] = hosts_result.get("data", []) except Exception: hosts_by_cluster[ext_id] = [] # Get storage containers try: containers_result = await client.v4_list( namespace="clustermgmt", path="config/storage-containers" ) containers = containers_result.get("data", []) except Exception: containers = [] # Get subnets try: subnets_result = await client.v4_list( namespace="networking", path="config/subnets" ) subnets = subnets_result.get("data", []) except Exception: subnets = [] # Get VMs vms = [] if include_vms: try: vms_result = await client.v4_list( namespace="vmm", path="ahv/config/vms" ) vms = vms_result.get("data", []) except Exception: vms = [] # Build markdown report markdown = _build_environment_markdown( detailed_clusters, hosts_by_cluster, vms, containers, subnets ) result: dict[str, Any] = {"report_markdown": markdown} # Build diagram if include_diagram: diagram_elements = _generate_environment_diagram( detailed_clusters, hosts_by_cluster ) result["excalidraw_diagram"] = { "type": "excalidraw", "version": 2, "elements": diagram_elements, "appState": {"viewBackgroundColor": "#ffffff"}, } return result - src/nutanix_mcp/tools/report.py:1174-1178 (registration)Handler dispatch mapping from tool name to handler function
REPORT_HANDLERS: dict[str, Any] = { "generate_environment_report": handle_generate_environment_report, "generate_cluster_report": handle_generate_cluster_report, "generate_vm_report": handle_generate_vm_report, }