Skip to main content
Glama

k8s_get_nodes

Retrieve Kubernetes cluster node details including status, roles, and version information to monitor infrastructure health and configuration.

Instructions

List all cluster nodes with status, roles, and version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getNodes function fetches the list of nodes from the Kubernetes API and formats them into a table string.
    export async function getNodes(): Promise<string> {
      const api = getCoreV1Api();
      const response = await api.listNode();
      const nodes = response.body.items;
    
      if (nodes.length === 0) {
        return "No nodes found in the cluster.";
      }
    
      const headers = ["NAME", "STATUS", "ROLES", "AGE", "VERSION"];
      const rows = nodes.map((node) => {
        const conditions = node.status?.conditions || [];
        const readyCond = conditions.find((c) => c.type === "Ready");
        const status = readyCond?.status === "True" ? "Ready" : "NotReady";
    
        const roles = Object.keys(node.metadata?.labels || {})
          .filter((l) => l.startsWith("node-role.kubernetes.io/"))
          .map((l) => l.replace("node-role.kubernetes.io/", ""))
          .join(",") || "<none>";
    
        // Check for taints that indicate scheduling issues
        const unschedulable = node.spec?.unschedulable ? ",SchedulingDisabled" : "";
    
        return [
          node.metadata?.name || "unknown",
          status + unschedulable,
          roles,
          node.metadata?.creationTimestamp ? formatAge(node.metadata.creationTimestamp) : "?",
          node.status?.nodeInfo?.kubeletVersion || "?",
        ];
      });
    
      return `Cluster nodes:\n\n${formatTable(headers, rows)}`;
    }
  • The tool definition for 'k8s_get_nodes' in the registration list.
      name: "k8s_get_nodes",
      description: "List all cluster nodes with status, roles, and version",
      inputSchema: { type: "object" as const, properties: {} },
    },
  • The switch-case entry that calls the 'getNodes' handler function.
    case "k8s_get_nodes": return getNodes();
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a list operation, implying read-only behavior, but does not disclose critical details like permissions needed, rate limits, output format, or pagination. This is inadequate for a tool with no annotation coverage.

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 action ('List all cluster nodes') and adds clarifying details ('with status, roles, and version') without any wasted words. It is appropriately sized for a simple tool.

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. It lacks information on behavioral aspects (e.g., permissions, rate limits) and output details (e.g., format, structure), which are essential for an agent to use this tool effectively in a Kubernetes context.

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?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description does not add parameter details, which is appropriate, earning a baseline score of 4 for this context.

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 action ('List all cluster nodes') and specifies what information is included ('with status, roles, and version'), making the purpose specific and complete. It distinguishes itself from sibling tools like 'k8s_describe_node' (detailed view) and 'k8s_top_nodes' (resource usage).

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 for retrieving node overviews, but does not explicitly state when to use this tool versus alternatives like 'k8s_describe_node' (for detailed node info) or 'k8s_top_nodes' (for resource metrics). No exclusions or prerequisites 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/batu-sonmez/infraclaude'

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