Skip to main content
Glama

get_node_details

Retrieve comprehensive Kubernetes node information by specifying context and node name to analyze cluster resources and status.

Instructions

Get detailed information about a specific node.

Args: context_name: The Kubernetes context name node_name: The name of the node to get details for

Returns: JSON string containing detailed information about the node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
node_nameYes

Implementation Reference

  • Handler function implementing the get_node_details tool. Uses Kubernetes CoreV1Api to fetch node details, extracts info, conditions, capacity, allocatable resources, labels, annotations, taints, addresses, and creation time, then returns as JSON.
    @mcp.tool()
    @use_current_context
    def get_node_details(context_name: str, node_name: str):
        """
        Get detailed information about a specific node.
    
        Args:
            context_name: The Kubernetes context name
            node_name: The name of the node to get details for
    
        Returns:
            JSON string containing detailed information about the node
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        node = core_v1.read_node(node_name)
    
        # Extract useful information
        node_info = node.status.node_info
        conditions = {cond.type: cond.status for cond in node.status.conditions}
        capacity = {k: v for k, v in node.status.capacity.items()}
        allocatable = {k: v for k, v in node.status.allocatable.items()}
    
        # Format taints if present
        taints = []
        if node.spec.taints:
            taints = [{
                "key": taint.key,
                "value": taint.value,
                "effect": taint.effect
            } for taint in node.spec.taints]
    
        # Extract labels and annotations
        labels = {}
        annotations = {}
        if node.metadata.labels:
            labels = node.metadata.labels
        if node.metadata.annotations:
            annotations = node.metadata.annotations
    
        result = {
            "name": node.metadata.name,
            "info": {
                "architecture": node_info.architecture,
                "bootID": node_info.boot_id,
                "containerRuntimeVersion": node_info.container_runtime_version,
                "kernelVersion": node_info.kernel_version,
                "kubeProxyVersion": node_info.kube_proxy_version,
                "kubeletVersion": node_info.kubelet_version,
                "machineID": node_info.machine_id,
                "operatingSystem": node_info.operating_system,
                "osImage": node_info.os_image,
                "systemUUID": node_info.system_uuid
            },
            "conditions": conditions,
            "capacity": capacity,
            "allocatable": allocatable,
            "labels": labels,
            "annotations": annotations,
            "taints": taints,
            "addresses": [{"type": addr.type, "address": addr.address} for addr in node.status.addresses],
            "created": node.metadata.creation_timestamp.strftime(
                "%Y-%m-%dT%H:%M:%SZ") if node.metadata.creation_timestamp else None
        }
    
        return json.dumps(result)
  • tools/node.py:29-29 (registration)
    The @mcp.tool() decorator registers the get_node_details function as an MCP tool.
    @mcp.tool()
  • Docstring provides input parameters and output description serving as schema for the tool.
    """
    Get detailed information about a specific node.
    
    Args:
        context_name: The Kubernetes context name
        node_name: The name of the node to get details for
    
    Returns:
        JSON string containing detailed information about the node
    """
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns 'JSON string containing detailed information about the node,' which is minimal but helpful. However, it lacks critical details like whether this is a read-only operation (implied but not stated), error conditions, authentication requirements, or rate limits—important for a Kubernetes tool with potential security implications.

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 and well-structured with clear sections for Args and Returns. Each sentence earns its place by defining the purpose and explaining parameters concisely. However, the 'JSON string' return statement could be more precise (e.g., specifying structure or key fields).

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?

Given the complexity (Kubernetes node details), lack of annotations, and no output schema, the description is minimally complete. It covers the basic purpose and parameters but lacks depth on behavioral traits, error handling, or example output. For a tool in a rich sibling set with security implications, more context would improve agent effectiveness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantics by explaining 'context_name' as 'The Kubernetes context name' and 'node_name' as 'The name of the node to get details for,' which clarifies their roles. However, it doesn't provide format examples, validation rules, or context on how to obtain these values, leaving gaps in usability.

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 the tool's purpose as 'Get detailed information about a specific node,' which is a specific verb+resource combination. It distinguishes from siblings like 'list_nodes' (which lists all nodes) and 'get_node_pods' (which focuses on pods on a node). However, it doesn't explicitly contrast with these siblings in the description text itself.

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 choose 'get_node_details' over 'list_nodes' or 'get_node_pods,' nor does it specify prerequisites or contextual constraints beyond the required parameters.

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