Skip to main content
Glama

k8s_cordon_node

Mark a Kubernetes node as unschedulable to prevent new pods from being scheduled, enabling safe maintenance or troubleshooting.

Instructions

Mark a node as unschedulable (cordon) — prevents new pods from being scheduled

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNode name

Implementation Reference

  • The handler function `cordonNode` that performs the actual K8s API call to cordon a node.
    export async function cordonNode(args: Record<string, unknown>): Promise<string> {
      const api = getCoreV1Api();
      const name = args.name as string;
      if (!name) throw new Error("Node name is required");
    
      await api.patchNode(
        name,
        { spec: { unschedulable: true } },
        undefined,
        undefined,
        undefined,
        undefined,
        undefined,
        { headers: { "Content-Type": "application/strategic-merge-patch+json" } }
      );
    
      return `Node '${name}' cordoned — no new pods will be scheduled on this node.`;
    }
  • Registration of the `k8s_cordon_node` tool definition in the Kubernetes toolset.
      name: "k8s_cordon_node",
      description: "Mark a node as unschedulable (cordon) — prevents new pods from being scheduled",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Node name" },
        },
        required: ["name"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only covers basic behavior: it marks a node unschedulable. It doesn't disclose critical traits like whether this is a reversible operation (though implied by sibling 'uncordon'), permission requirements, rate limits, or what happens to existing pods (they continue running). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding safety and side effects.

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 with zero wasted words. It front-loads the core action ('Mark a node as unschedulable') and immediately clarifies the effect ('prevents new pods from being scheduled'), making it easy to parse quickly.

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 one parameter with full schema coverage and no output schema, the description adequately explains the tool's purpose. However, as a mutation tool with no annotations, it lacks details on behavioral traits like idempotency, error conditions, or response format, which would help an agent use it correctly. It's minimally viable but has clear gaps in safety and operational context.

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 100% with one parameter ('name' as 'Node name'), so the schema already documents it fully. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema does all the work.

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 specific action ('Mark a node as unschedulable') and resource ('node'), with the parenthetical '(cordon)' providing precise Kubernetes terminology. It distinguishes from its sibling 'k8s_uncordon_node' by specifying the opposite effect, and from other k8s tools by focusing on node scheduling rather than describing, getting, or deleting resources.

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 context by stating 'prevents new pods from being scheduled,' suggesting this tool is used when you want to stop new workloads on a node (e.g., for maintenance). However, it doesn't explicitly state when to use this versus alternatives like 'k8s_delete_pod' for removing existing pods, or mention prerequisites like needing node name from 'k8s_get_nodes.'

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