Skip to main content
Glama

apply

Apply Kubernetes manifests from files or URLs to deploy and manage resources in your cluster. Specify a namespace or use the current context.

Instructions

Apply a Kubernetes manifest from a file or URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the manifest file or URL
namespaceNoThe namespace to apply to (optional, defaults to current context namespace)

Implementation Reference

  • Handler function for the 'apply' tool. It destructures 'file' and optional 'namespace' from arguments, constructs the kubectl apply command, executes it using execAsync, and returns the stdout or a success message.
    case "apply": {
      const { file, namespace } = args;
      const nsArg = namespace ? `-n ${namespace}` : "";
      const cmd = `kubectl apply -f ${file} ${nsArg}`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ 
          type: "text", 
          text: stdout || `Applied manifest from ${file}` 
        }]
      };
    }
  • Schema definition for the 'apply' tool in the tools array, used for list tools response. Specifies input parameters: required 'file' string and optional 'namespace' string.
    name: "apply",
    description: "Apply a Kubernetes manifest from a file or URL",
    inputSchema: {
      type: "object",
      properties: {
        file: { 
          type: "string",
          description: "Path to the manifest file or URL"
        },
        namespace: { 
          type: "string",
          description: "The namespace to apply to (optional, defaults to current context namespace)"
        }
      },
      required: ["file"]
    }
  • server.js:1392-1394 (registration)
    Generic registration handler for listing all tools, including 'apply', by returning the static 'tools' array containing its schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions applying a manifest but doesn't disclose critical behaviors: whether it's idempotent, if it creates or updates resources, what happens on errors, authentication needs, or rate limits. This is a significant gap for a mutation tool with zero annotation coverage.

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's front-loaded with the core action and resource, making it easy to scan and understand quickly without unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral details (e.g., idempotency, error handling), usage context, and output expectations. Given the complexity of Kubernetes operations, this leaves significant gaps for an AI agent to use the tool correctly.

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 both parameters ('file' and 'namespace'). The description adds minimal value by implying the 'file' parameter can be a path or URL, but doesn't provide additional syntax or format details beyond what the schema states. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('apply') and resource ('Kubernetes manifest') with source specification ('from a file or URL'). It distinguishes from siblings like 'create-namespace' or 'patch' by focusing on manifest application, though it doesn't explicitly differentiate from similar tools like 'run' or 'create-backup' that might also deploy resources.

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 when to choose 'apply' over 'create-namespace' for namespace creation or 'patch' for updates, nor does it specify prerequisites like needing kubectl access or a valid manifest format.

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/thekaranpargaie/kube-mcp'

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