Skip to main content
Glama

ako_clusters

Read-onlyIdempotent

List all Kubernetes clusters that have AKO deployed, including their version and operational status.

Instructions

[READ] List all K8s clusters that have AKO deployed, with version and status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'ako_clusters'. Decorated with @mcp.tool and @vmware_tool, it imports list_clusters from vmware_avi.ops.ako_multi_cluster and runs it via _capture_output to return formatted Rich console output as a string.
    def ako_clusters() -> str:
        """[READ] List all K8s clusters that have AKO deployed, with version and status."""
        from vmware_avi.ops.ako_multi_cluster import list_clusters
        return _capture_output(list_clusters)
  • Core implementation of list_clusters() invoked by the ako_clusters tool. Runs 'kubectl config get-contexts' to discover all K8s contexts, then checks each for AKO pods in avi-system namespace to report status and version via a Rich table.
    def list_clusters() -> None:
        """List all K8s contexts and their AKO deployment status."""
        result = subprocess.run(
            ["kubectl", "config", "get-contexts", "-o", "name"],
            capture_output=True,
            text=True,
            timeout=30,
        )
        if result.returncode != 0:
            console.print(f"[red]Failed to list contexts: {result.stderr.strip()}[/red]")
            raise SystemExit(1)
    
        contexts = [c.strip() for c in result.stdout.strip().split("\n") if c.strip()]
    
        table = Table(title="AKO Cluster Overview")
        table.add_column("Context")
        table.add_column("AKO Status")
        table.add_column("AKO Version")
    
        for ctx in contexts:
            pod_check = subprocess.run(
                [
                    "kubectl", "--context", ctx,
                    "get", "pods", "-n", "avi-system",
                    "-l", "app.kubernetes.io/name=ako",
                    "-o", "jsonpath={.items[0].status.phase}:{.items[0].spec.containers[0].image}",
                ],
                capture_output=True,
                text=True,
                timeout=30,
            )
            if pod_check.returncode == 0 and pod_check.stdout:
                parts = pod_check.stdout.split(":", 1)
                phase = parts[0] if parts else "Unknown"
                image = parts[1] if len(parts) > 1 else "N/A"
                version = image.split(":")[-1] if ":" in image else "latest"
                status_color = "green" if phase == "Running" else "red"
                table.add_row(ctx, f"[{status_color}]{phase}[/{status_color}]", version)
            else:
                table.add_row(ctx, "[dim]Not deployed[/dim]", "-")
    
        console.print(table)
  • Test registration entry confirming 'ako_clusters' is part of the expected 29-tool set exposed by the MCP server.
        "ako_clusters",
        "ako_cluster_overview",
        "ako_amko_status",
    }
  • CLI command registration for 'ako clusters' subcommand that also calls list_clusters(), mirroring the MCP tool functionality.
    @ako_app.command("clusters")
    def ako_clusters_cmd() -> None:
        """List all clusters with AKO deployed."""
        from vmware_avi.ops.ako_multi_cluster import list_clusters
    
        list_clusters()
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. The description adds that it lists clusters with version and status, which is useful but does not disclose additional behavioral traits beyond annotations.

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 sentence with a '[READ]' prefix for clarity. It is concise and front-loaded with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (no parameters, rich annotations, output schema exists), the description is complete. It sufficiently explains what the tool does and what it returns.

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?

There are no parameters, so the schema already covers everything. The description adds no parameter-level information, which is acceptable since none are needed. Baseline 4 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 verb (list), resource (K8s clusters with AKO), and output (version and status). It distinguishes from sibling tools like 'ako_cluster_overview' which likely provides more detail.

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?

The description implies usage as a read/query tool but does not explicitly state when to use this vs alternatives like 'ako_cluster_overview' or other 'ako_' tools. No when-not or alternative guidance is provided.

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/zw008/VMware-AVI'

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