get_tkc_kubeconfig
Retrieve a kubeconfig for a Tanzu Kubernetes Cluster to access it. Specify name and namespace, optionally write to a file to keep session tokens out of agent context.
Instructions
[WRITE] Get a kubeconfig for one TKC cluster.
Marked [WRITE] because output_path, when given, mkdir -p's and truncates
a caller-chosen file. It reads the managed cluster, but this family's marker
means "no side effects", and writing a credentials file is one. With no
output_path nothing is written and the kubeconfig is returned inline —
this docstring previously said it defaulted to ~/.kube/config, which was
never true of either the tool or the CLI. Its sibling
vmware-aiops.vm_guest_download was corrected the same way in the same
round; the two had been given opposite answers to the same question.
Returns {cluster, kubeconfig}, or {cluster, written_to} when output_path is given. Run list_tkc_clusters first for name and namespace; use get_supervisor_kubeconfig instead for Supervisor-level access. Security: it carries a short-lived session token — always prefer output_path so the credential never enters agent context.
Reads vSphere but is NOT annotated readOnlyHint — output_path creates directories and truncates a caller-chosen file, so output_path='~/.kube/config' overwrites the user's own kubeconfig. readOnlyHint is what an MCP client consults to decide whether to ask the user first, and it is about this tool's whole environment, not just vSphere. The [READ] marker above stays accurate for what it answers: nothing in the managed cluster changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | TKC cluster name. | |
| target | No | vCenter in config.yaml; omit for the default. | |
| namespace | Yes | Namespace holding it. | |
| output_path | No | File to write, e.g. '~/.kube/my.yaml'. Omit to return the kubeconfig inline. |