get_cluster_info
Report which Kubernetes cluster these tools are bound to, so you can verify the data's source when multiple clusters are involved.
Instructions
Report which Kubernetes cluster these tools are bound to. Call this first when more than one cluster could be involved, and before drawing conclusions that depend on which cluster the data came from.
The binding is made once (at server startup, or on the first tool call) and
shared by every tool, so all tools answer from this cluster.
Parameters
----------
None
This function does not take any parameters.
Returns
-------
ClusterInfo
An object with the following fields:
source : str
"kubeconfig" (bound through a kubeconfig context), "in-cluster" (the
service account of the pod the server runs in), or "capture" (a
recorded snapshot of a cluster being replayed, not a live cluster).
context : Optional[str]
The kubeconfig context name. None for in-cluster config, and for a
capture that did not record one.
server : Optional[str]
URL of the cluster's API server.
kubeconfig : Optional[str]
Path of the kubeconfig file (or ``:``-separated list of files) the
binding was read from. None unless source is "kubeconfig".
server_version : Optional[str]
Kubernetes version reported by the API server, e.g. "v1.31.2". None if
the server could not be reached, or the capture did not record it.
captured_at : Optional[datetime.datetime]
For a capture, when it was taken; every age and timestamp the tools
return is relative to that moment. None for a live cluster.
Raises
------
K8sConfigError
If no cluster configuration can be loaded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | No | ||
| source | Yes | ||
| context | No | ||
| kubeconfig | No | ||
| captured_at | No | ||
| server_version | No |