Skip to main content
Glama

remove_node_taint

Remove taints from Kubernetes nodes to allow pod scheduling by specifying context, node name, and taint key for cluster management.

Instructions

Remove a taint from a node.

Args: context_name: The Kubernetes context name node_name: The name of the node to modify taint_key: The taint key to remove

Returns: JSON string containing the updated node taints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
node_nameYes
taint_keyYes

Implementation Reference

  • The remove_node_taint tool handler function. It removes a specified taint from a Kubernetes node by patching the node's spec taints list after filtering out the matching taint key. Includes decorators for MCP tool registration (@mcp.tool()) and context usage (@use_current_context). Returns JSON with updated taints or messages if not found/no taints.
    @mcp.tool()
    @use_current_context
    def remove_node_taint(context_name: str, node_name: str, taint_key: str):
        """
        Remove a taint from a node.
    
        Args:
            context_name: The Kubernetes context name
            node_name: The name of the node to modify
            taint_key: The taint key to remove
    
        Returns:
            JSON string containing the updated node taints
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
    
        # Get the current node
        node = core_v1.read_node(node_name)
    
        # Check if the node has taints
        if not node.spec.taints:
            result = {
                "name": node_name,
                "taints": [],
                "message": "Node has no taints"
            }
            return json.dumps(result)
    
        # Filter out the taint to remove
        updated_taints = [taint for taint in node.spec.taints if taint.key != taint_key]
    
        # Check if taint was found
        if len(updated_taints) == len(node.spec.taints):
            result = {
                "name": node_name,
                "taints": [{"key": taint.key, "value": taint.value, "effect": taint.effect}
                           for taint in node.spec.taints],
                "message": f"Taint with key '{taint_key}' not found"
            }
            return json.dumps(result)
    
        # Apply the patch
        body = {
            "spec": {
                "taints": [
                    {
                        "key": taint.key,
                        "value": taint.value,
                        "effect": taint.effect
                    } for taint in updated_taints
                ]
            }
        }
    
        patched_node = core_v1.patch_node(node_name, body)
    
        # Format the taints for response
        response_taints = []
        if patched_node.spec.taints:
            response_taints = [
                {
                    "key": taint.key,
                    "value": taint.value,
                    "effect": taint.effect
                } for taint in patched_node.spec.taints
            ]
    
        result = {
            "name": patched_node.metadata.name,
            "taints": response_taints
        }
    
        return json.dumps(result)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Remove a taint') and return format ('JSON string containing the updated node taints'), but lacks critical details like required permissions, whether this is a destructive/mutating operation, error conditions, or side effects. For a Kubernetes node modification tool, this is insufficient.

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 uses minimal, purposeful sentences. The 'Args' and 'Returns' sections are particularly efficient. However, the initial purpose statement could be slightly more informative about the tool's scope.

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 3 parameters with 0% schema coverage and no output schema, the description provides basic parameter semantics and return format. However, for a Kubernetes node modification tool with no annotations, it lacks crucial context about permissions, side effects, error handling, and relationship to sibling tools. The description is minimally adequate but has significant gaps.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic explanations for all three parameters ('context_name: The Kubernetes context name', 'node_name: The name of the node to modify', 'taint_key: The taint key to remove'), adding meaningful context beyond the bare schema. However, it doesn't explain parameter formats or constraints (e.g., what constitutes a valid taint key).

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 action ('Remove a taint') and target resource ('from a node'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling tools like 'remove_node_label' or 'add_node_taint', which would require a 5.

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?

No guidance is provided on when to use this tool versus alternatives like 'add_node_taint' or 'remove_node_label', nor any prerequisites or context for usage. The description only states what it does, not when to use it.

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