Skip to main content
Glama

Read anything in a cluster with kubectl

kubectl_read

Run read-only kubectl commands to troubleshoot Kubernetes workloads: inspect pods, describe resources, read logs, view events, and explain issues without allowing cluster changes.

Instructions

Run a READ-ONLY kubectl command — get, describe, logs, top, events, explain. Anything that would change the cluster is refused by the same classifier the portal's own console uses. This is the troubleshooting tool: describe a failing pod, read its logs, look at events in a namespace.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>",
      "cluster": "<cluster>",
      "command": "<command>"
    },
    "name": "kubectl_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
clusterYescluster id, from `clusters`
commandYesthe kubectl command WITHOUT the word kubectl, e.g. `describe pod web-7d9 -n dev` or `logs deploy/api -n dev --tail=200`
projectYesproject id, from `clusters`

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden here and does real work: it discloses that write operations will be refused and identifies the enforcement mechanism ('the same classifier the portal's own console uses'), which is a genuine behavioral trait an agent cannot see in the schema. Gaps remain around required permissions, output/error shape, and whether the target cluster must be connected, which keeps it below a 5.

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?

Three short sentences, front-loaded with the read-only constraint, with no filler. There is mild redundancy between the subcommand list and the troubleshooting examples that follow it, but each sentence still contributes.

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?

For a three-parameter, fully-described schema with no output schema, the description covers purpose, safety boundary, and concrete call patterns adequately. It does not describe what a returned result or a refusal looks like, which would help since there is no output schema to fall back on.

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% and both cluster/project and the command format (including worked examples with -n and --tail) are already documented in the schema. The description adds essentially no parameter-level meaning beyond reinforcing that the command excludes the literal word kubectl, so the baseline 3 applies.

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 names a specific verb ('Run a READ-ONLY kubectl command') and enumerates the permitted subcommands (get, describe, logs, top, events, explain), which tells an agent exactly what the tool does. It is not a tautology of the title. It stops short of a 5 because it never explicitly contrasts itself with the overlapping siblings (events, pods, nodes), leaving the agent to infer that those are narrower, purpose-built alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'This is the troubleshooting tool' plus concrete scenarios (describe a failing pod, read its logs, look at events in a namespace) gives clear when-to-use context. There are no explicit exclusions or named alternatives, so the agent is not told when to pick `events` or `pods` instead of this general tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.