Skip to main content
Glama

cp

Copy files between local machine and Kubernetes pods to transfer logs, configurations, or application data within cluster environments.

Instructions

Copy files to/from a pod

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
podYesThe name of the pod
sourceYesSource path (local:path or pod:path)
destinationYesDestination path (local:path or pod:path)
namespaceNoThe namespace of the pod (optional, defaults to current context namespace)
containerNoThe container name (if pod has multiple containers)

Implementation Reference

  • The execution handler for the 'cp' tool. It constructs a 'kubectl cp' command to copy files from a source (assumed local) to the pod's destination path, using provided namespace and container if specified.
    case "cp": {
      const { pod, source, destination, namespace, container } = args;
      const nsArg = namespace ? `-n ${namespace}` : "";
      const containerArg = container ? `-c ${container}` : "";
      const cmd = `kubectl cp ${source} ${pod}:${destination} ${nsArg} ${containerArg}`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ 
          type: "text", 
          text: stdout || `File copied from ${source} to ${pod}:${destination}` 
        }]
      };
    }
  • The input schema definition for the 'cp' tool, specifying parameters like pod name, source and destination paths, namespace, and container.
      name: "cp",
      description: "Copy files to/from a pod",
      inputSchema: {
        type: "object",
        properties: {
          pod: { 
            type: "string",
            description: "The name of the pod"
          },
          source: { 
            type: "string",
            description: "Source path (local:path or pod:path)"
          },
          destination: { 
            type: "string",
            description: "Destination path (local:path or pod:path)"
          },
          namespace: { 
            type: "string",
            description: "The namespace of the pod (optional, defaults to current context namespace)"
          },
          container: { 
            type: "string",
            description: "The container name (if pod has multiple containers)"
          }
        },
        required: ["pod", "source", "destination"]
      }
    },
  • server.js:1392-1394 (registration)
    Registration of the tool list handler, which returns the array of tools including the 'cp' tool 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 copying but doesn't disclose behavioral traits like whether it overwrites files, requires specific permissions, handles errors, or has rate limits. The phrase 'to/from a pod' hints at bidirectional transfer but lacks operational details, making it insufficient for a mutation tool.

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 parse quickly, though it sacrifices detail for brevity.

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 tool's complexity (file copying with 5 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or operational constraints, leaving significant gaps for an agent to invoke it correctly in a Kubernetes context.

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 5 parameters thoroughly. The description adds no additional meaning beyond implying 'pod' as a target and 'source/destination' as paths, but doesn't clarify syntax or usage beyond what the schema provides, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Copy files to/from a pod' states the basic action (copy) and resource (files, pod), but is vague about scope and directionality. It doesn't specify whether this copies between local and pod, between pods, or both, nor does it distinguish from sibling tools like 'exec' or 'port-forward' which might handle file transfers differently.

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. With many sibling tools for pod operations (e.g., 'exec', 'debug-pod', 'port-forward'), the description lacks context about prerequisites, typical use cases, or exclusions, leaving the agent to infer usage from the tool name alone.

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