Skip to main content
Glama

cordon_node

Mark a Kubernetes node as unschedulable to prevent new pods from being scheduled on it, useful for maintenance or troubleshooting operations.

Instructions

Cordon a node (mark as unschedulable).

Args: context_name: The Kubernetes context name node_name: The name of the node to cordon

Returns: JSON string containing the result of the operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
node_nameYes

Implementation Reference

  • The cordon_node tool handler: decorates with @mcp.tool() and @use_current_context, reads the node, checks if already cordoned, patches spec.unschedulable to True if not, returns JSON status.
    @mcp.tool()
    @use_current_context
    def cordon_node(context_name: str, node_name: str):
        """
        Cordon a node (mark as unschedulable).
    
        Args:
            context_name: The Kubernetes context name
            node_name: The name of the node to cordon
    
        Returns:
            JSON string containing the result of the operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
    
        # Get the current node
        node = core_v1.read_node(node_name)
    
        # Check if already cordoned
        if node.spec.unschedulable:
            result = {
                "name": node_name,
                "status": "already cordoned",
                "unschedulable": True
            }
            return json.dumps(result)
    
        # Apply the patch
        body = {
            "spec": {
                "unschedulable": True
            }
        }
    
        patched_node = core_v1.patch_node(node_name, body)
    
        result = {
            "name": patched_node.metadata.name,
            "status": "cordoned",
            "unschedulable": patched_node.spec.unschedulable
        }
    
        return json.dumps(result)
  • tools/node.py:355-355 (registration)
    Registers the cordon_node function as an MCP tool using the @mcp.tool() decorator.
    @mcp.tool()
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 states the basic operation. It doesn't disclose important behavioral traits like required permissions, whether this is a destructive/mutating operation, what happens to existing pods on the node, or any rate limits/constraints. The description is minimal beyond the core action.

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 well-structured with clear sections (purpose, Args, Returns) and front-loads the core action. It's appropriately sized for a 2-parameter tool, though the 'Returns' section could be more informative given no output schema exists.

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 mutation tool with no annotations and no output schema, the description provides adequate basic information but lacks important context about the operation's consequences, permissions needed, or what the JSON return contains. It covers the minimum but leaves significant gaps for proper agent understanding.

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, the description compensates by clearly documenting both parameters in the Args section with meaningful names and purposes. It adds semantic understanding beyond the bare schema, though it doesn't provide format details or examples for the parameters.

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 ('Cordon a node') and defines what it means ('mark as unschedulable'), providing a precise verb+resource combination. It effectively distinguishes this tool from its sibling 'uncordon_node' by specifying the opposite operation.

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 through the action definition, but doesn't explicitly state when to use this tool versus alternatives like 'uncordon_node' or other node management tools. No explicit exclusions or prerequisites are mentioned.

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