get_neighborhood
Investigates cross-resource failures by returning the BFS-expanded topology neighborhood around a known Kubernetes resource, tracing dependencies, owners, and references.
Instructions
Use when investigating cross-resource failures around a known resource: service routing, targetPort/selector/endpoints problems, dependency timeouts, config/secret refs, owner chains, or traffic not reaching pods. Returns the BFS-expanded topology neighborhood around one root, which is usually cheaper and clearer than get_topology once you have a suspect. Typical flow: issues/search/list_resources identify a Service or workload, then get_neighborhood traces its upstream/downstream Services, workloads, Pods, refs, and owners. Profile auto (default) picks a bounded edge set from the root kind; profile all expands every edge type and is heavier, use it only when auto produced a too-narrow neighborhood. Hops defaults to 1 and maxes at 2. Nodes are RBAC-filtered; denied neighbors appear only as aggregate omitted counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | resource kind: pod, deployment, service, application, etc. | |
| group | No | API group required to disambiguate kinds that collide across groups. Examples: serving.knative.dev for KNative Service (vs core/v1 Service), cluster.x-k8s.io for CAPI Cluster (vs CNPG Cluster), networking.istio.io for Istio Gateway (vs gateway.networking.k8s.io Gateway). Omit for kinds with no known collisions. | |
| namespace | No | resource namespace; omit for cluster-scoped kinds | |
| name | Yes | resource name | |
| profile | No | neighborhood breadth: auto or all. Default: auto (picks a bounded edge set from the root kind). all expands every edge type and is heavier; use only when auto produced a too-narrow neighborhood. | |
| hops | No | BFS depth. Default 1, max 2. | |
| max_nodes | No | node-budget cap. Default 25. When the cap is hit mid-expansion, truncated=true is set and the partial subgraph is returned. |