Skip to main content
Glama

k8s_scale_deployment

Scale Kubernetes deployments to adjust replica counts for managing application capacity and resource allocation in your cluster.

Instructions

Scale a deployment to a specified number of replicas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDeployment name
namespaceNoKubernetes namespace (default: 'default')
replicasYesDesired number of replicas

Implementation Reference

  • The actual implementation of the tool, performing the scale operation via Kubernetes API patch.
    export async function scaleDeployment(args: Record<string, unknown>): Promise<string> {
      const api = getAppsV1Api();
      const namespace = (args.namespace as string) || "default";
      const name = args.name as string;
      const replicas = args.replicas as number;
    
      if (!name) throw new Error("Deployment name is required");
      if (replicas === undefined) throw new Error("Replicas count is required");
    
      const patch = { spec: { replicas } };
      await api.patchNamespacedDeployment(
        name,
        namespace,
        patch,
        undefined,
        undefined,
        undefined,
        undefined,
        undefined,
        { headers: { "Content-Type": "application/strategic-merge-patch+json" } }
      );
    
      return `Deployment '${name}' scaled to ${replicas} replicas in namespace '${namespace}'.`;
    }
  • Tool registration definition for "k8s_scale_deployment" including its input schema.
      name: "k8s_scale_deployment",
      description: "Scale a deployment to a specified number of replicas",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Deployment name" },
          namespace: { type: "string", description: "Kubernetes namespace (default: 'default')" },
          replicas: { type: "number", description: "Desired number of replicas" },
        },
        required: ["name", "replicas"],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions scaling but lacks critical behavioral details: it doesn't specify that this is a mutation (potentially destructive), what permissions are required, whether it's idempotent, how it handles errors, or if there are rate limits. For a Kubernetes scaling tool with zero annotation coverage, this is a significant gap in transparency.

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 waste—it directly states the tool's purpose without fluff. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the complexity of a Kubernetes scaling operation, no annotations, and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., mutation effects, error handling), usage context, and return values. For a tool that modifies cluster state, this minimal description leaves too many gaps for safe and effective use.

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%, so the schema already documents all parameters (name, namespace, replicas) with descriptions. The description adds no additional parameter semantics beyond implying 'replicas' is the target count. Baseline is 3 when the schema does the heavy lifting, and the description doesn't compensate with extra details like format constraints or examples.

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 ('scale') and resource ('deployment') with a specific outcome ('to a specified number of replicas'). It's unambiguous but doesn't explicitly differentiate from sibling tools like 'k8s_rollback_deployment' or 'k8s_get_deployments', which would require mentioning it's a scaling operation rather than status checking or rollback.

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. For example, it doesn't mention prerequisites (e.g., needing a deployment to exist), when not to use it (e.g., for other resource types), or how it relates to siblings like 'k8s_get_deployments' for checking current replicas. The description only states what it does, not when to apply 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/batu-sonmez/infraclaude'

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