k8s_describe_node
Retrieve comprehensive Kubernetes node details including resource capacity, allocatable resources, system conditions, and taints for infrastructure management and troubleshooting.
Instructions
Get detailed node info including capacity, allocatable resources, conditions, and taints
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Node name |
Implementation Reference
- src/tools/kubernetes/nodes.ts:39-78 (handler)The handler function 'describeNode' which queries the Kubernetes API for detailed node information.
export async function describeNode(args: Record<string, unknown>): Promise<string> { const api = getCoreV1Api(); const name = args.name as string; if (!name) throw new Error("Node name is required"); const response = await api.readNode(name); const node = response.body; const allocatable = node.status?.allocatable || {}; const capacity = node.status?.capacity || {}; const lines: string[] = [ `Name: ${node.metadata?.name}`, `OS: ${node.status?.nodeInfo?.osImage || "?"}`, `Kernel: ${node.status?.nodeInfo?.kernelVersion || "?"}`, `Runtime: ${node.status?.nodeInfo?.containerRuntimeVersion || "?"}`, `Kubelet: ${node.status?.nodeInfo?.kubeletVersion || "?"}`, "", "Capacity:", ` CPU: ${capacity.cpu || "?"}`, ` Memory: ${capacity.memory || "?"}`, ` Pods: ${capacity.pods || "?"}`, "", "Allocatable:", ` CPU: ${allocatable.cpu || "?"}`, ` Memory: ${allocatable.memory || "?"}`, ` Pods: ${allocatable.pods || "?"}`, "", "Conditions:", ]; for (const cond of node.status?.conditions || []) { lines.push(` ${cond.type}: ${cond.status} — ${cond.message || ""}`); } const taints = node.spec?.taints || []; if (taints.length > 0) { lines.push("", "Taints:"); for (const taint of taints) { - The definition and input schema for the 'k8s_describe_node' tool.
{ name: "k8s_describe_node", description: "Get detailed node info including capacity, allocatable resources, conditions, and taints", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Node name" }, }, required: ["name"], }, }, - src/tools/kubernetes/index.ts:209-209 (registration)The switch case that dispatches the 'k8s_describe_node' tool name to its handler implementation.
case "k8s_describe_node": return describeNode(a);