Skip to main content
Glama

import_cluster

Import a Kubernetes cluster by providing its kubeconfig as a file path or full text. The tool validates client certificate and key pairing, then adds the cluster for management.

Instructions

导入集群配置。

kubeconfig 参数接受三种形式:

  1. 服务端文件路径(如 /app/data/.../xxx.yaml)

  2. kubeconfig 完整文本内容(可直接传入,服务端会自动校验证书与私钥匹配)

  3. 用户提供的本地文件路径(服务端不可达时需先上传,见下方)

服务端会自动校验 client-certificate-data 与 client-key-data 是否匹配。 如果内容在传输过程中被损坏,校验会失败并返回包含 curl 上传指引的错误信息。

Args: name: 集群名称(仅允许字母、数字、点、下划线、连字符) kubeconfig: 服务端文件路径 或 kubeconfig 完整文本内容 service_account: 服务账户名称,默认为default namespace: 默认命名空间,默认为default is_default: 是否设为默认集群,默认为False

Returns: 导入结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
namespaceNodefault
is_defaultNo
kubeconfigYes
service_accountNodefault
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It does mention that the server validates cert-key match and returns error with curl upload instructions, which is useful. However, it does not disclose whether importing overwrites an existing cluster, what permissions are required, whether the operation is reversible, or what the actual return payload contains. This is a significant gap for a state-changing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with a short summary, a clear numbered list for kubeconfig forms, an Args section, and a Returns line. It is appropriately sized, though the phrase '见下方' (see below) is slightly confusing as the upload guidance appears in the error message section, not literally below.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks guidance on when to use this tool vs load_kubeconfig, what happens on overwrite, required access levels, and a meaningful return description. The kubeconfig parameter is well covered, but overall operational context is insufficient for an agent to use this tool safely and effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description fully compensates by explaining every argument: name character constraints, kubeconfig three accepted forms with context, and defaults for service_account, namespace, and is_default. This goes well beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states '导入集群配置' (Import cluster configuration), using a specific verb and resource. It is distinct from sibling tools like list/delete clusters, though it does not explicitly differentiate from load_kubeconfig. The return value '导入结果' is vague, slightly weakening purpose clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides detailed guidance on how to specify the kubeconfig parameter, including three accepted forms and when a local file needs to be uploaded. However, it does not explicitly state when to use this tool versus alternatives such as load_kubeconfig, nor does it mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tobewont/k8s-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server