Skip to main content
Glama

Run Kubernetes Analysis Code

run_code
Read-onlyIdempotent

Executes bounded TypeScript with top-level await to inspect and debug Kubernetes resources, leveraging discovered capabilities and returning values from scripts.

Instructions

Execute bounded TypeScript with top-level await against progressively discovered Kubernetes capabilities. Use tools.list(), tools.search(), tools.help(), and typed namespaces; inspect tools.disabled() for policy denials. Return a value from the script. Full documentation and types are available through the code-mode prompt and file:///sys/global.d.ts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesTypeScript code to execute via the sandboxed runtime. Top-level await is supported.
inputNoOptional input payload available to the script.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
resultNo
stderrNo
stdoutNo
isErrorNo
successYes
Behavior4/5

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

The description adds valuable behavioral context beyond the annotations, such as 'bounded' execution, top-level await, 'progressively discovered' capabilities, and the ability to inspect tools.disabled() for policy denials. It does not contradict the readOnly, non-destructive, idempotent hints, and it enhances understanding of the sandboxed runtime.

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 three sentences, front-loaded with the core purpose in the first sentence. Every sentence earns its place: the second explains how to interact with the environment, and the third points to additional documentation. There is no redundancy or filler.

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 (arbitrary code execution in Kubernetes) and the presence of an output schema, the description is quite complete. It covers the execution model, discovery mechanism, policy-denial introspection, and where to find full docs. It does not explicitly address when to prefer this over kube_pod_exec, but the different purposes are implicit. Overall, it is sufficient for an agent to invoke 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 coverage is 100% for the two parameters, so the baseline is 3. The description adds minor clarification (e.g., 'Return a value from the script' implies the code parameter should produce a return value), but it largely repeats what the schema already states (TypeScript code, top-level await support). It does not add substantial parameter-level semantics beyond the schema.

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 clearly states the tool executes bounded TypeScript with top-level await against Kubernetes capabilities, using a specific verb ('Execute') and resource ('bounded TypeScript'). It distinguishes itself from the sibling tool kube_pod_exec by focusing on analysis code rather than command execution in pods.

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?

The description provides explicit guidance on how to use the tool: use tools.list(), tools.search(), tools.help(), and typed namespaces, and inspect tools.disabled() for policy denials. It implies this is the tool for exploring and analyzing Kubernetes capabilities, but does not explicitly compare it to the sibling or state when not to use it, so it falls short of a full when/when-not guideline.

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