k8s_inventory
Generate a one-shot cluster snapshot returning resource summaries or overview counts per namespace, excluding pod details and optionally including metadata-only ConfigMaps/Secrets and Istio CRDs.
Instructions
⭐ One-shot comprehensive cluster snapshot. Use for documentation, audits, or any task that needs broad visibility — replaces ~50 individual k8s_get calls.
Read-only: fans out many kubectl get -o json calls only — never mutates the
cluster, idempotent. Requires broad read access (or read on the given
namespace); kinds that are Forbidden/absent are skipped silently rather than
failing the whole call. Pods are excluded from the payload (counts only).
Modes:
"full" (default): expand each namespaced item to its summarized form (deployment images, service ports, etc.). Use for documentation or audits.
"overview": skip per-item expansion. Each namespace entry carries only a
by_kind_countsmap. ~10-20× smaller payload. Use to scan cluster shape before drilling in with namespace-scoped follow-up calls.
By default, ConfigMap and Secret lists are EXCLUDED — they are typically the largest noise-to-signal source in cluster-wide inventories. Set include_config_resources=True to include them in by_kind_counts and the per-namespace breakdown. ConfigMap data and Secret values are NEVER returned — only metadata.
Pods are NOT included in the snapshot (potentially huge); only per-namespace pod counts are surfaced. Use k8s_triage for pod health, k8s_get pod for specifics.
Istio CRDs (Gateway / VirtualService / DestinationRule) are auto-included when present; absent CRDs are silently skipped. Set include_istio=False to skip.
Args: namespace: Limit scope to a single namespace; omit for cluster-wide. mode: "full" (default, expand items) or "overview" (counts only). include_config_resources: Include ConfigMaps and Secrets (default False). include_istio: Auto-detect and include Istio CRDs (default True). context: kubeconfig context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Detail level. "full" (default) expands each item to summarized fields; "overview" returns per-namespace by_kind_counts only (~10-20× smaller). Only these two values are accepted. | full |
| context | No | kubeconfig context name; omit to use the current context. | |
| namespace | No | Limit the snapshot to one namespace; omit for a cluster-wide snapshot. | |
| include_istio | No | Auto-detect and include Istio CRDs (Gateway/VirtualService/DestinationRule) when present. Default true; absent CRDs are skipped. | |
| include_config_resources | No | Include ConfigMaps and Secrets in counts and per-namespace breakdown. Default false (they are the biggest noise source). Values are NEVER returned either way — metadata only. |