Skip to main content
Glama

k8s_get

Read-only tool to list or fetch Kubernetes resources, returning summarized key fields per resource. Idempotent and safe for repeated calls, requires kubectl read access.

Instructions

List or fetch K8s resources, returning summarized key fields per resource.

Read-only: runs kubectl get -o json only — never creates, mutates, or deletes anything, and is safe to call repeatedly (idempotent). Requires a kubeconfig with read/list access to the target kind/namespace; raises on kubectl failure (e.g. NotFound, Forbidden, unreachable cluster). Output is summarized (not raw spec) to keep tokens low; Secret/ConfigMap values are never included. For deeper detail (events, conditions, container info), use k8s_describe.

Args: kind: Resource kind. Common: pod, svc, deploy, sts, ds, cm, secret, ns, node, ingress, gateway, virtualservice, destinationrule, hpa, pvc. namespace: Target namespace; omit to scan all namespaces. name: Specific resource name; omit to list multiple. selector: K8s label selector, e.g. "app=foo,env=prod". context: kubeconfig context to use; defaults to current context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesResource kind (singular, plural, or short alias). Accepted: pod/po, svc/service, deploy/deployment, sts/statefulset, ds/daemonset, rs/replicaset, cm/configmap, secret, ns/namespace, node, ingress, hpa, pvc, job, cronjob, sa/serviceaccount, and the Istio kinds gateway/virtualservice/destinationrule. Other lowercase kinds are passed through. Secret/ConfigMap VALUES are never returned — metadata only.
nameNoExact resource name to fetch one item. Omit to list many. Must match ^[a-zA-Z0-9._-]{1,253}$. No partial/glob matching.
contextNokubeconfig context name. Omit to use the current context. Cannot inject a KUBECONFIG path.
selectorNoK8s label selector, comma-separated, e.g. "app=foo,env=prod" or "tier!=cache". Ignored when `name` is given.
namespaceNoTarget namespace. Omit to scan ALL namespaces (adds -A). Must match ^[a-zA-Z0-9._-]{1,253}$.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: read-only (runs kubectl get -o json only), idempotent, never creates/mutates/deletes, returns summarized output, excludes Secret/ConfigMap values, and raises on failures. This is comprehensive and exceeds the burden.

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?

The description is well-structured, starting with purpose then behavioral details, followed by parameter list. It is informative yet concise, though some redundancy exists (e.g., repeating namespace pattern) that could be trimmed.

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

Completeness5/5

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

Given the tool's complexity, 100% schema coverage, and presence of output schema, the description is complete. It covers behavior, permissions, limitations, output format, and cross-references sibling tools, leaving no significant gaps.

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 baseline is 3. The description adds some context (e.g., common kind examples, effect of omitting namespace/name, selector ignored when name given) but does not significantly extend beyond what the schema already provides.

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 lists or fetches K8s resources (specific verb+resource) and summarizes key fields. It differentiates from the sibling k8s_describe by noting that k8s_get provides summarized output while k8s_describe offers deeper detail.

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

Usage Guidelines5/5

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

The description explicitly states when to use (read-only operations), that it is safe to call repeatedly, and provides clear alternative: for deeper detail use k8s_describe. It also notes prerequisites (kubeconfig with read/list access) and error conditions.

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/kaka-milan-22/kops'

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