Skip to main content
Glama

resize_node_pool

Adjust the node count in a GKE cluster's node pool by specifying the project, cluster, location, node pool, and desired node count.

Instructions

    Resize a node pool in a GKE cluster.
    
    Args:
        project_id: The ID of the GCP project
        cluster_name: The name of the GKE cluster
        location: The location (region or zone) of the cluster
        node_pool_name: The name of the node pool to resize
        node_count: The new node count for the pool
    
    Returns:
        Result of the node pool resize operation
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_nameYes
locationYes
node_countYes
node_pool_nameYes
project_idYes

Implementation Reference

  • The resize_node_pool tool handler. Decorated with @mcp.tool() for registration. Uses Google Cloud Container_v1 client to get node pool details, check autoscaling, and initiate resize operation via set_node_pool_size.
        @mcp.tool()
        def resize_node_pool(project_id: str, cluster_name: str, location: str, node_pool_name: str, node_count: int) -> str:
            """
            Resize a node pool in a GKE cluster.
            
            Args:
                project_id: The ID of the GCP project
                cluster_name: The name of the GKE cluster
                location: The location (region or zone) of the cluster
                node_pool_name: The name of the node pool to resize
                node_count: The new node count for the pool
            
            Returns:
                Result of the node pool resize operation
            """
            try:
                from google.cloud import container_v1
                
                # Initialize the GKE client
                client = container_v1.ClusterManagerClient()
                
                # Create the node pool path
                node_pool_path = f"projects/{project_id}/locations/{location}/clusters/{cluster_name}/nodePools/{node_pool_name}"
                
                # Get the current node pool
                node_pool = client.get_node_pool(name=node_pool_path)
                current_node_count = node_pool.initial_node_count
                
                # Check if autoscaling is enabled
                if node_pool.autoscaling and node_pool.autoscaling.enabled:
                    return f"""
    Cannot resize node pool {node_pool_name} because autoscaling is enabled.
    To manually set the node count, you must first disable autoscaling for this node pool.
    Current autoscaling settings:
    - Min nodes: {node_pool.autoscaling.min_node_count}
    - Max nodes: {node_pool.autoscaling.max_node_count}
    """
                
                # Resize the node pool
                request = container_v1.SetNodePoolSizeRequest(
                    name=node_pool_path,
                    node_count=node_count
                )
                operation = client.set_node_pool_size(request=request)
                
                return f"""
    Node pool resize operation initiated:
    - Cluster: {cluster_name}
    - Location: {location}
    - Node Pool: {node_pool_name}
    - Current Node Count: {current_node_count}
    - New Node Count: {node_count}
    
    Operation ID: {operation.name}
    Status: {operation.status.name if hasattr(operation.status, 'name') else operation.status}
    """
            except Exception as e:
                return f"Error resizing node pool: {str(e)}"
  • Invocation of register_tools for kubernetes module, which registers the resize_node_pool tool (and others) to the FastMCP server instance.
    kubernetes_tools.register_tools(mcp)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states 'Resize a node pool in a GKE cluster' and returns 'Result of the node pool resize operation.' It does not reveal that this is a mutating operation with potential side effects like scaling, cost impact, long-running operations, or required permissions.

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 concise and well-structured, with a one-line purpose statement followed by a straightforward Args list and a brief Returns note. It is front-loaded and contains no redundant or filler content, making efficient use of space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a mutating operation with five required parameters and no output schema or annotations. The description only provides a high-level purpose and a vague return statement. It lacks critical context such as whether node_count is incremental or absolute, potential wait times, prerequisites like cluster availability, and side effects like cost or resource changes, making it incomplete for an agent to invoke reliably.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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. The Args section lists all parameters with brief descriptions, but most are rephrased parameter names (e.g., 'project_id: The ID of the GCP project'). Only 'node_count' adds meaningful clarification by stating it is the 'new node count,' implying a target value rather than a delta. Constraints and allowed values are absent.

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 tool's function with a specific verb+resource: 'Resize a node pool in a GKE cluster.' This distinguishes it from sibling tools like list_node_pools, which focuses on listing pools, by explicitly targeting the resize action.

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 when a node pool's node count needs adjustment, but it does not provide explicit when-to-use or when-not-to-use guidance, alternatives, or prerequisites. There is no mention of when to choose this tool over other node pool operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.