Skip to main content
Glama

Execute Command in Kubernetes Pod

kube_pod_exec
Destructive

Execute a command in a Kubernetes pod container via the API and capture stdout/stderr output.

Instructions

Execute a command in a container of a pod via the Kubernetes API (no kubectl). Captures stdout/stderr and returns them when the command completes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ttyNoAllocate a TTY (default false)
argsNoExact argv to execute without a shell, e.g., ["/bin/ls","-la"]. Provide this OR command.
argvNoWhitespace-separated argv to execute without a shell (e.g., "/usr/bin/env printenv"). Convenience for CLI; prefer args[] when possible.
shellNoShell binary used when command is provided (default /bin/sh)
stdinNoOptional data to write to process stdin before closing it
commandNoShell command to run. Defaults to trying /bin/bash first, then /bin/sh, then other common shells. Provide this OR args[].
podNameYesName of the target Pod
containerNoContainer name (optional; defaults to first container)
namespaceNoKubernetes namespace (defaults to "default")
timeoutSecondsNoMaximum time to wait for command completion (default 60s)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNo
stderrYes
stdoutYes
commandNo
Behavior4/5

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

Annotations already disclose mutation (readOnlyHint=false) and destructiveness (destructiveHint=true). The description adds meaningful behavioral context by stating that stdout/stderr are captured and returned only when the command completes, which implies blocking behavior and output aggregation. This goes beyond the structured annotations without contradicting them.

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 two concise sentences that front-load the core action ('Execute a command in a container of a pod') and immediately add the key behavioral detail about output capture. Every word earns its place, with no redundancy or fluff.

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

Completeness4/5

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

Given the tool's complexity (10 parameters, a oneOf construct, output schema, and annotations covering safety), the description covers the essential context: what it does and how it returns output. It could add more usage differentiation vs. run_code, but the clear title and schema make it adequate for an annotated tool.

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?

The input schema has 100% description coverage, detailing all 10 parameters including the oneOf alternatives for args/argv/command. The description itself contributes no parameter-specific information, but the schema fully explains semantics, so the baseline score of 3 is appropriate.

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 explicitly states the tool executes a command in a pod container via the Kubernetes API, with the phrase 'no kubectl' distinguishing it from a kubectl-based approach. It clearly identifies the verb (execute), resource (pod container), and method, and further notes output capture, providing a complete purpose.

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 for Kubernetes pod execution via the Kubernetes API, but it does not explicitly compare to the sibling tool run_code or offer when/when-not guidance. The 'no kubectl' designation provides a minor usage hint but is not a clear alternative comparison.

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/mikhae1/kubeview-mcp'

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