Skip to main content
Glama

list_nodes

Retrieve all Kubernetes cluster nodes with basic information by specifying the context name to manage resources across multiple clusters.

Instructions

List all nodes in the Kubernetes cluster.

Args: context_name: The Kubernetes context name

Returns: JSON string containing basic information about all nodes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes

Implementation Reference

  • The list_nodes tool, decorated with @mcp.tool(), implements the core logic to list all Kubernetes nodes in the specified context, returning their names as JSON.
    @mcp.tool()
    @use_current_context
    def list_nodes(context_name: str):
        """
        List all nodes in the Kubernetes cluster.
    
        Args:
            context_name: The Kubernetes context name
    
        Returns:
            JSON string containing basic information about all nodes
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        nodes = core_v1.list_node()
        result = [{"name": node.metadata.name} for node in nodes.items]
        return json.dumps(result)
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. While 'List all nodes' implies a read operation, it doesn't disclose important behavioral traits like whether this requires specific permissions, whether it's paginated, what 'basic information' includes, or potential rate limits. The description mentions the return format but doesn't describe the structure or fields of the JSON response.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with clear sections: purpose statement, Args, and Returns. Each section is front-loaded with essential information. The structure is efficient with zero wasted sentences, though the 'Args' and 'Returns' formatting could be more integrated with the main description.

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

Completeness3/5

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

For a read operation with no annotations, no output schema, and minimal parameters, the description provides basic purpose and parameter explanation. However, it lacks important context about what 'basic information' includes, potential limitations, authentication requirements, or error conditions. Given the complexity of Kubernetes operations and the lack of structured metadata, more behavioral context would be helpful.

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?

With 0% schema description coverage and only 1 parameter, the description adds significant value by explaining that 'context_name' is 'The Kubernetes context name'. This provides essential semantic meaning that the schema lacks. The description doesn't explain what a Kubernetes context is or provide examples, but it does clarify the parameter's purpose beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List all nodes in the Kubernetes cluster' which is a specific verb+resource combination. It distinguishes from siblings like 'get_node_details' or 'get_node_pods' by indicating it returns basic information about all nodes rather than detailed information or pods. However, it doesn't explicitly differentiate from other list operations like 'list_namespaces' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to use 'list_nodes' versus 'get_node_details' for more detailed information, or 'get_node_pods' for pod information. There's no context about prerequisites or when this operation is appropriate versus other node-related operations.

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/bourbonkk/k8s-pilot'

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