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
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Resource 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. | |
| name | No | Exact resource name to fetch one item. Omit to list many. Must match ^[a-zA-Z0-9._-]{1,253}$. No partial/glob matching. | |
| context | No | kubeconfig context name. Omit to use the current context. Cannot inject a KUBECONFIG path. | |
| selector | No | K8s label selector, comma-separated, e.g. "app=foo,env=prod" or "tier!=cache". Ignored when `name` is given. | |
| namespace | No | Target namespace. Omit to scan ALL namespaces (adds -A). Must match ^[a-zA-Z0-9._-]{1,253}$. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |