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)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'resize' implies a mutation, it doesn't address critical aspects like required permissions, whether the operation is reversible, potential downtime, rate limits, or error conditions. This leaves significant gaps for safe agent usage.

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 a clear purpose statement followed by parameter documentation. It's appropriately sized and front-loaded, though the Returns section is somewhat vague ('Result of the node pool resize operation') and could be more specific.

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 5 parameters, no annotations, and no output schema, the description provides good parameter documentation but lacks behavioral context. It's minimally adequate but has clear gaps in usage guidance and operational transparency that would help an agent use it correctly.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides clear, meaningful documentation for all 5 parameters in the Args section, explaining what each parameter represents. This is excellent compensation for the 0% schema description coverage, adding substantial value beyond the bare schema.

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 ('resize') and resource ('node pool in a GKE cluster'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from potential siblings like 'list_node_pools' or 'create_instance', 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?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints. It lacks any mention of when-not-to-use scenarios or how it relates to sibling tools like 'list_node_pools' or 'get_cluster_details' for verification.

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

Related 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/henihaddad/gcp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server