Skip to main content
Glama

get_node_details

Retrieve comprehensive node details in JSON format from Kubernetes clusters managed by MCP server k8s-pilot. Provide context name and node name as input to fetch specific information.

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 logic. Decorated with @mcp.tool() which registers it as an MCP tool. Fetches detailed node information from Kubernetes API including info, conditions, capacity, allocatable resources, labels, annotations, taints, addresses, and creation time.
    @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)

Other Tools

Related 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