k8s-mcp-server
Manages CephFilesystem resources and other custom resources via the dynamic resource service, enabling CRUD operations on Ceph-related Kubernetes custom resources.
Provides comprehensive management of Kubernetes clusters, including cluster configuration, resource CRUD operations, batch operations, backups, diagnostics, and more.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@k8s-mcp-serverlist pods in the default namespace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Kubernetes MCP Server
python k8s-version license
English | 中文
基于 MCP Python SDK(FastMCP Server API)的 Kubernetes MCP Server,提供完整的 Kubernetes API 操作功能。
🔥 主要特性
纯 API 实现:完全通过 Kubernetes Python Client 实现,无需依赖 kubectl 命令行工具
标准 MCP 协议:基于 MCP Python SDK 的 FastMCP Server API,遵循 MCP (Model Context Protocol) 标准
智能集群管理:支持多集群配置管理,自动加载默认集群配置
全面的 K8s 操作:支持 35 个工具函数,覆盖所有主要 Kubernetes 资源的完整 CRUD 操作
多租户认证:可选 JWT 认证,支持多用户数据隔离、权限 Profile 分级、Tool 可见性过滤
集群诊断:提供集群健康检查、资源使用分析等诊断功能
配置管理:支持 kubeconfig 文件的保存、切换和管理
多传输协议:支持 Stdio、标准 Streamable HTTP 与 SSE 兼容传输
容器化部署:支持 Docker 和 Kubernetes 部署,包含完整的 k8s 清单文件
资源备份恢复:支持命名空间和单个资源的备份恢复,按集群/命名空间/资源类型层级存储
变更验证预览:自动验证资源操作并显示具体的变更内容,提供操作前的详细预览
配套 Agent Skill:提供
skills/k8s-manage/SKILL.md,可直接用于 Cursor Agent / 其他 AI Agent,包含完整的工具清单、参数说明、操作流程和连接方式指引
Related MCP server: Multi Cluster Kubernetes MCP Server
⚡ 快速开始
环境要求
Python 3.12+
uv 0.4+(统一管理依赖与运行环境,无需手动维护 venv 或 pip)
无需安装 kubectl(完全通过 Python API 实现)
安装 uv
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"安装依赖
# 同步依赖:自动创建 .venv、按 pyproject.toml 解析并安装所有运行时依赖
uv sync
# 如需开发工具(pytest / pylint / black / mypy 等)
uv sync --extra dev后续新增/移除依赖请使用
uv add <pkg>/uv remove <pkg>,不要再使用pip install。
本地配置
# 复制示例配置,按需修改 .env
cp env.example .env服务启动时会自动读取当前工作目录下的 .env,但不会覆盖已经存在的系统环境变量。完整配置项见 env.example。
启动服务
# 默认 stdio 模式启动(推荐用于 MCP 客户端)
k8s-mcp-server
# 或明确指定 stdio 模式
k8s-mcp-server --transport stdio
# Streamable HTTP 模式启动(推荐 Cursor 等 HTTP MCP 客户端)
k8s-mcp-server --transport streamable --host 0.0.0.0 --port 8000
# SSE 模式启动(兼容旧 SSE 客户端)
k8s-mcp-server --transport sse --host 0.0.0.0 --port 8000
# 或使用 uvicorn 直接启动 HTTP 服务
uvicorn tools:app --host 0.0.0.0 --port 8000
uv sync会把k8s-mcp-server、mcp-admin和uvicorn安装到.venv/bin(Windows 为.venv\Scripts)。如未激活虚拟环境,可以使用uv run k8s-mcp-server ...临时运行。
Stdio 模式:通过标准输入输出与 MCP 客户端通信(默认)
SSE 模式:通过 Server-Sent Events 接口(GET http://localhost:8000/sse + POST http://localhost:8000/message)提供兼容服务
Streamable HTTP 模式:标准 MCP Streamable HTTP 单端点协议,推荐 Cursor 等客户端使用(http://localhost:8000/mcp)
Cursor MCP 配置
在 Cursor 全局 MCP 配置(如 ~/.cursor/mcp.json 或项目 .cursor/mcp.json)中添加:
{
"mcpServers": {
"k8s-mcp-server": {
"url": "http://localhost:8000/mcp"
}
}
}启动服务:k8s-mcp-server --transport streamable --port 8000
备选 Stdio 模式(无需先启动 HTTP 服务):
{
"mcpServers": {
"k8s-mcp-server": {
"command": "k8s-mcp-server",
"args": ["--transport", "stdio"],
"cwd": "项目路径"
}
}
}配置后重启 Cursor 或执行 Developer: Reload Window,即可在 MCP 工具列表中看到工具。
未启用认证时可见 32 个工具;启用认证后 admin 角色可见全部 35 个,viewer 13 个、developer 21 个、operator 30 个。
Agent Skill(可选)
项目附带 Cursor Agent Skill 文件 skills/k8s-manage/SKILL.md,包含完整的工具清单、参数说明、连接方式和操作流程。将其安装到 Cursor 后,Agent 能自动发现并正确使用 K8s MCP 工具,无需手动提示。
安装方式:将 skills/k8s-manage/ 目录复制到 ~/.cursor/skills/ 下:
# macOS / Linux
cp -r skills/k8s-manage ~/.cursor/skills/
# Windows
xcopy /E /I skills\k8s-manage %USERPROFILE%\.cursor\skills\k8s-manage安装后 Cursor Agent 在涉及 K8s 集群管理的对话中会自动加载该 Skill。
容器化部署
# 构建 Docker 镜像
docker build -t k8s-mcp-server:latest .
# 运行容器
docker run -d --name k8s-mcp-server \
-p 8000:8000 \
-v $(pwd)/data:/app/data \
k8s-mcp-server:latest
# 在 Kubernetes 中部署
kubectl apply -f k8s/🏗️ 架构设计
核心组件
k8s-mcp-server/
├── services/
│ ├── __init__.py
│ ├── factory.py # 服务实例工厂(按 kubeconfig_path 缓存)
│ ├── k8s_advanced_service.py # Kubernetes 进阶服务(批量操作、备份恢复、RBAC、验证)
│ ├── dynamic_resource_service.py # 动态资源服务(DynamicClient,支持 CRD 及任意 API 资源)
│ ├── k8s_api/ # Kubernetes API 服务层(模块化)
│ │ ├── base.py, cluster_ops.py, pod_ops.py, workload_ops.py
│ │ ├── jobcronjob_ops.py, networking_storage_ops.py, service_config_ops.py
│ │ ├── autoscaling_policy_ops.py, rbac_ops.py, interactive_ops.py
│ │ └── resource_builders.py
│ └── k8s_advanced/ # 进阶服务逻辑(批量、备份、验证、RBAC)
│ ├── batch_ops.py, backup_restore.py, validation.py
│ ├── resource_conversion.py, rbac_advanced.py
│ └── base.py
├── tools/
│ ├── __init__.py # FastMCP 实例和工具模块导入
│ ├── k8s_tools.py # 核心 K8s 资源管理工具 (5个)
│ ├── cluster_tools.py # 多集群配置管理 (9个)
│ ├── diagnostic_tools.py # 集群诊断工具 (6个)
│ ├── batch_tools.py # 批量操作工具 (8个)
│ ├── backup_tools.py # 备份恢复工具 (4个)
│ └── auth_tools.py # 认证与用户管理 (3个,仅认证模式可见)
├── utils/
│ ├── __init__.py
│ ├── cluster_config.py # 集群配置管理类(支持多租户隔离)
│ ├── context.py # 上下文管理
│ ├── fastmcp_custom.py # 自定义 FastMCP(含 Tool 可见性过滤)
│ ├── auth_context.py # 请求级用户上下文(contextvars)
│ ├── jwt_service.py # JWT 签发/验证
│ ├── jwt_middleware.py # ASGI JWT 认证中间件
│ ├── permission_profiles.py # 权限 Profile 管理(内置 + 自定义)
│ ├── token_store.py # JWT 签发记录持久化
│ ├── revocation_store.py # JWT 撤销列表
│ ├── admin_routes.py # 管理 API 路由
│ ├── k8s_helpers.py # K8s 辅助函数
│ ├── k8s_parsers.py # 参数解析
│ ├── param_parsers.py # 参数解析
│ ├── operations_logger.py # 操作日志
│ ├── backup_paths.py # 备份路径
│ └── decorators.py, response.py, mcp_server.py
├── k8s/ # Kubernetes 部署文件
│ ├── deployment.yaml # 主要部署配置
│ ├── service.yaml # 服务暴露配置
│ ├── configmap.yaml # 配置管理
│ ├── pvc.yaml # 数据持久化
│ └── README.md # 部署指南
├── data/
│ ├── clusters.json # 集群配置存储
│ ├── kubeconfigs/ # kubeconfig 文件存储目录
│ ├── backup/ # 备份存储(按集群/命名空间/资源类型层级)
│ └── copyfiles/ # Pod 文件拷贝本地保存目录
├── tests/ # 回归测试
│ └── regression_test.py # 同步/异步 37 个用例
├── skills/
│ └── k8s-manage/SKILL.md # Skill(工具清单、参数、连接方式、操作流程)
├── docs/
│ └── TOOLS.md # 工具清单文档
├── Dockerfile # 容器镜像构建文件
├── .dockerignore # Docker 构建排除文件
├── config.py # 服务配置
├── main.py # 服务启动入口
└── pyproject.toml # 依赖列表Service 层架构
服务层采用三层设计,职责分离、便于扩展:
服务 | 位置 | 角色 | 实现方式 | 覆盖范围 |
KubernetesAPIService | services/k8s_api/ | 底层 API 封装 | 强类型 API(V1Api、AppsV1Api 等),多 Mixin 模块化 | 内置资源(Pod、Deployment、Service 等) |
DynamicResourceService | dynamic_resource_service.py | 动态资源操作 | DynamicClient,运行时发现 API | 任意资源(内置 + CRD + 未来新增) |
KubernetesAdvancedService | k8s_advanced_service.py + k8s_advanced/ | 编排与业务层 | 组合上述两者及 BatchOps、BackupRestore、Validation 等 Mixin | 批量操作、备份恢复、验证等 |
调用策略:批量操作时优先使用预定义方法,若资源类型未命中则 fallback 到 DynamicResourceService,从而支持 CephFilesystem、KafkaTopic 等 CRD 及集群中所有可发现的 API 资源。服务实例通过 services.factory.get_k8s_api_service() / get_k8s_advanced_service() 获取,按 kubeconfig_path 缓存。
架构特点
Service 层:三层架构(API 层 + 动态层 + 编排层),内置资源与 CRD 统一入口
Tool 层:使用
@mcp.tool装饰器定义 MCP 工具函数统一 MCP 实例:所有工具共享同一个 FastMCP 实例
双重传输:同时支持 SSE 和 stdio 两种传输方式
智能配置:自动加载默认集群配置,无需每次指定 kubeconfig
集群管理:内置完整的多集群配置管理系统
容器化支持:提供 Docker 和 Kubernetes 部署支持
🛠️ 主要功能
工具分类总览
分类 | 模块 | 工具数 | 说明 |
认证管理 | auth_tools | 3 | whoami、用户/Token 管理、权限 Profile 管理(仅认证模式可见) |
核心工具 | k8s_tools | 5 | 集群信息、Pod 日志(含 previous)、执行命令、Pod 文件拷贝、端口转发(含启停管理) |
集群管理 | cluster_tools | 9 | 集群导入/切换、kubeconfig 管理 |
诊断工具 | diagnostic_tools | 6 | 集群/节点/Pod 健康、资源使用、事件、节点管理(drain/cordon/uncordon) |
批量操作 | batch_tools | 8 | 批量增删改查、重启、发布操作、top 资源;支持集群所有 API 资源(含 CRD) |
备份恢复 | backup_tools | 4 | 命名空间/资源备份与恢复 |
说明:list_clusters 查看已导入的集群注册信息(省略 name 列出全部,指定 name 返回单个集群详情);list_kubeconfigs 列出 data/kubeconfigs/ 目录下保存的 kubeconfig 文件。
认证与用户管理 (auth_tools.py)
仅在
MCP_AUTH_ENABLED=true时可见。
whoami()- 查看当前用户身份、角色、Token 有效期、已授权的集群与权限admin_manage_users(action, ...)- 用户与 Token 管理(admin 全功能;operator 限 viewer/developer 权限和 user 角色 token)admin_manage_profiles(action, ...)- 权限 Profile 模板管理(查看/创建/更新/删除自定义 profile,仅 admin)
K8s 资源管理 (batch_tools.py)
批量操作工具
batch_list_resources()- 批量查询资源;resource_types="all"可列出集群所有可用 API 资源类型batch_create_resources()- 批量创建资源(支持事务回滚)batch_update_resources()- 批量更新资源batch_delete_resources()- 批量删除资源batch_describe_resources()- 批量获取资源详细信息batch_restart_resources()- 批量重启资源(Deployment、StatefulSet、DaemonSet)batch_rollout_resources()- 批量发布操作:status 查看状态、undo 回滚(支持指定 revision)、pause 暂停、resume 恢复batch_top_resources()- 批量查看 Node/Pod 的 CPU、内存使用(类似 kubectl top,依赖 metrics-server)
核心工具 (k8s_tools.py)
get_cluster_info()- 获取集群信息(API 版本、服务器地址等)get_pod_logs()- 获取 Pod 日志(支持previous获取上一实例日志)exec_pod_command()- 在 Pod 中执行命令copy_pod_files()- Pod 文件读写:from_pod 将文件内容返回给客户端(支持local_path直接保存到本地,二进制文件自动解码),to_pod 将客户端内容或本地文件写入 Podport_forward()- Pod 端口转发管理:action="start"启动转发、action="stop"停止指定转发、action="list"列出活跃会话;认证模式下按用户隔离
集群管理工具 (cluster_tools.py)
import_cluster()- 导入集群配置(支持服务端文件路径或直接传入内容;自动校验证书与私钥匹配,部分 AI 模型传输长 base64 时可能损坏内容,校验失败时返回 curl 文件上传指引)list_clusters(name?)- 查看集群配置(省略 name 列出全部,指定 name 返回详情)delete_cluster()- 删除集群配置set_default_cluster()- 设置默认集群test_cluster_connection()- 测试集群连接(自动刷新服务缓存,从磁盘重载 kubeconfig)load_kubeconfig()- 加载 kubeconfig 文件(支持脱敏)list_kubeconfigs()- 列出所有保存的 kubeconfig 文件delete_kubeconfig()- 删除 kubeconfig 文件get_kubeconfig_info()- 获取 kubeconfig 详情或验证格式
诊断工具 (diagnostic_tools.py)
check_cluster_health()- 检查集群健康状态,可选include_rbac_check附带 RBAC 权限冲突检测check_node_health()- 检查节点健康状态check_pod_health()- 检查 Pod 健康状态(支持筛选失败 Pod)get_cluster_resource_usage()- 获取集群资源使用情况(支持指定命名空间)get_cluster_events()- 获取集群事件manage_node()- 节点运维管理:action="drain"排水(cordon + 驱逐 Pod)、action="cordon"标记不可调度、action="uncordon"恢复调度
支持的批量操作资源类型
支持集群中所有可发现的 API 资源(含 CRD)。以下为内置优化类型,其他类型通过 DynamicClient 自动发现并操作。
工作负载资源:
Deployment - 部署管理
StatefulSet - 有状态应用
DaemonSet - 守护进程集
Job - 批处理任务(支持labels和annotations更新)
CronJob - 定时任务
网络与服务:
Service - 服务暴露
Ingress - 入口控制器
NetworkPolicy - 网络策略
配置与存储:
ConfigMap - 配置管理
Secret - 敏感信息管理
StorageClass - 存储类
PersistentVolume - 持久化卷
PersistentVolumeClaim - 持久化卷声明
ResourceQuota - 资源配额
权限与身份管理:
Namespace - 命名空间
ServiceAccount - 服务账户
Role - 角色(命名空间级别)
ClusterRole - 集群角色
RoleBinding - 角色绑定(命名空间级别)
ClusterRoleBinding - 集群角色绑定
自动扩缩容:
HorizontalPodAutoscaler (HPA) - 水平Pod自动扩缩容
批量操作特性
原子性操作:支持事务性批量操作,失败时自动回滚
统一接口:所有资源类型使用相同的批量操作接口
灵活参数:支持完整资源定义和简化参数两种方式
错误处理:详细的错误信息和成功/失败统计
向后兼容:不影响现有的单资源操作功能
备份和恢复工具 (backup_tools.py)
backup_namespace()- 备份整个命名空间backup_resource()- 备份特定资源restore_from_backup()- 从备份恢复资源list_backups()- 列出备份文件
自动备份(变更前安全网)
batch_update_resources 与 batch_delete_resources 在执行变更前会自动备份受影响资源的当前状态,备份路径会随工具响应一同返回(auto_backup 字段),可直接用于 restore_from_backup 回滚。无需用户手动触发。
文件格式:YAML,与命名空间/资源备份保持一致
路径:
data/backup/<cluster>/namespaces/<ns>/resources/<type>/<name>/<name>_auto_<timestamp>.yaml保留期:通过
MCP_BACKUP_RETENTION_DAYS配置(默认 90 天,按文件 mtime 计算),超期后在后续备份操作时自动清理;设为0可关闭清理
变更验证预览系统
系统内置了自动的资源操作验证和预览功能,自动集成到所有写操作中:
核心特性
自动验证:所有创建、更新、删除操作自动执行验证检查
具体预览:显示详细的变更内容,而非模糊的数量描述
操作支持性检查:验证特定资源类型是否支持指定操作
风险提示:删除操作显示不可逆风险警告
预览输出示例
具体变更:
labels.version: 1.0 → 2.0新增内容:
data.redis.conf: 新增 = host: redis\nport: 6379RBAC规则:
rules: 新增规则 [batch] jobs -> get,list,create删除提醒:
⚠️ 将删除资源 configmap/test,此操作不可逆
支持的资源类型
涵盖所有主要 Kubernetes 资源的验证和预览:
工作负载:Deployment, StatefulSet, DaemonSet, Job, CronJob
网络服务:Service, Ingress, NetworkPolicy
配置存储:ConfigMap, Secret, PVC, PV, StorageClass, ResourceQuota
权限管理:ServiceAccount, Role, ClusterRole, RoleBinding, ClusterRoleBinding
集群资源:Namespace, Node
自动扩缩容:HorizontalPodAutoscaler (HPA)
🔥 特殊功能
优雅删除:部分删除函数支持
grace_period_seconds参数,实现优雅或强制删除批量操作:所有列表函数支持
label_selector参数进行筛选数据持久化:支持配置和数据的持久化存储
健康检查:提供容器健康检查端点
批量资源操作:支持批量创建、更新、删除多个资源,支持事务回滚
发布管理:支持 Deployment/StatefulSet/DaemonSet 的 status、undo(含指定 revision)、pause、resume
资源监控:
batch_top_resources查看 Node/Pod 的 CPU、内存使用(依赖 metrics-server)Pod 文件读写:
copy_pod_files支持 Pod 文件双向传输,内容直接通过响应/参数传递,不依赖服务端磁盘备份恢复:支持命名空间和单个资源的备份恢复,按集群/命名空间/资源类型层级存储
权限 Profile:内置 viewer/developer/operator/admin 四级权限模板,工具可见性与 K8s RBAC 严格匹配;低权限用户调用集群级工具时优雅降级(返回部分结果或友好提示);支持自定义 Profile、自动创建 K8s RBAC 资源;operator 可委托管理 viewer/developer 用户
变更验证预览:自动验证所有写操作并显示具体变更内容,提供详细的操作预览
📝 使用示例
通过 MCP 客户端调用
所有功能都可以通过 MCP 客户端调用。系统支持自动加载默认集群配置:
// 批量列出资源(使用默认集群配置)
{
"method": "tools/call",
"params": {
"name": "batch_list_resources",
"arguments": {
"resource_types": "pods,nodes,namespaces",
"namespace": "default"
}
}
}
// 批量删除资源(支持 grace_period_seconds)
{
"method": "tools/call",
"params": {
"name": "batch_delete_resources",
"arguments": {
"resources": "[{\"kind\":\"Pod\",\"name\":\"my-pod\"}]",
"namespace": "default",
"grace_period_seconds": 30
}
}
}
// 批量创建资源
{
"method": "tools/call",
"params": {
"name": "batch_create_resources",
"arguments": {
"resources": "[{\"kind\": \"Deployment\", \"metadata\": {\"name\": \"app1\"}, \"spec\": {\"name\": \"app1\", \"image\": \"nginx:latest\", \"replicas\": 3}}, {\"kind\": \"Service\", \"metadata\": {\"name\": \"app1-svc\"}, \"spec\": {\"name\": \"app1-svc\", \"selector\": {\"app\": \"app1\"}, \"ports\": [{\"port\": 80}]}}]",
"namespace": "default"
}
}
}
// 备份命名空间
{
"method": "tools/call",
"params": {
"name": "backup_namespace",
"arguments": {
"namespace": "my-app",
"include_secrets": true
}
}
}
// 批量操作会自动显示验证和预览信息
// 更新操作会显示具体的变更内容,如:
// "📋 预览变化:"
// " • replicas: 3 → 5"
// " • labels.version: 1.0 → 2.0"
// 批量创建资源
{
"method": "tools/call",
"params": {
"name": "batch_create_resources",
"arguments": {
"resources": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {"name": "app1", "namespace": "default"},
"spec": {"replicas": 2, "selector": {"matchLabels": {"app": "app1"}}, "template": {"metadata": {"labels": {"app": "app1"}}, "spec": {"containers": [{"name": "app1", "image": "nginx:1.20"}]}}}
},
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {"name": "app1-svc", "namespace": "default"},
"spec": {"selector": {"app": "app1"}, "ports": [{"port": 80, "targetPort": 80}]}
}
],
"namespace": "default"
}
}
}
// 批量更新Job的labels和annotations
{
"method": "tools/call",
"params": {
"name": "batch_update_resources",
"arguments": {
"resources": [
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "job1",
"namespace": "default",
"labels": {"app": "batch-job", "version": "v2", "updated": "true"},
"annotations": {"description": "Updated batch job", "last-modified": "2025-01-08"}
}
}
],
"namespace": "default"
}
}
}
// 完全使用默认配置(集群和命名空间)
{
"method": "tools/call",
"params": {
"name": "batch_list_resources",
"arguments": {
"resource_types": "pods",
"namespace": "default"
}
}
}响应格式
所有工具都返回标准化的响应格式:
{
"success": true,
"pods": [...],
"count": 5,
"namespace": "default"
}🐳 Docker 部署
构建镜像
# 构建镜像
docker build -t k8s-mcp-server:latest .
# 运行容器
docker run -d --name k8s-mcp-server \
-p 8000:8000 \
-v $(pwd)/data:/app/data \
k8s-mcp-server:latest环境变量
docker run -d \
-e SSE_HOST=0.0.0.0 \
-e SSE_PORT=8000 \
-e LOG_LEVEL=INFO \
-e DATA_DIR=/app/data \
k8s-mcp-server:latest☸️ Kubernetes 部署
快速部署
# 部署所有资源
kubectl apply -f k8s/
# 查看部署状态
kubectl get pods -l app=k8s-mcp-server
kubectl get svc k8s-mcp-server部署组件
Deployment: 主要应用部署,支持数据持久化
Service: 服务暴露,支持 ClusterIP、NodePort、Ingress 方式
ConfigMap: 环境变量和配置管理
PersistentVolumeClaim: 数据持久化(集群配置、kubeconfig、备份、用户操作日志)
数据持久化
# 数据存储卷(含集群配置、kubeconfig、备份、用户操作日志等)
- name: data-volume
persistentVolumeClaim:
claimName: k8s-mcp-server-data健康检查
livenessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 5
periodSeconds: 5🔧 配置
环境变量
项目提供 env.example 作为完整示例,可复制为 .env 用于本地启动。以下是常用配置:
# SSE 服务配置
SSE_HOST=0.0.0.0
SSE_PORT=8000
# 数据存储目录(自动创建)
DATA_DIR=./data # 集群配置、kubeconfig、备份等数据根目录
# 备份保留策略(按文件修改时间计算,过期自动清理;0 表示永不清理)
MCP_BACKUP_RETENTION_DAYS=90 # 默认 90 天
# MCP 路径配置
MCP_STREAMABLE_PATH=/mcp # Streamable HTTP 单端点
MCP_SSE_PATH=/sse # SSE 连接端点
MCP_MESSAGE_PATH=/message # SSE 消息 POST 端点
# 日志级别
LOG_LEVEL=info
# 认证配置(可选,默认不启用)
MCP_AUTH_ENABLED=false # 设为 true 启用 JWT 认证和多租户隔离
MCP_JWT_SECRET= # JWT 签名密钥(启用认证时必填)
MCP_JWT_ALGORITHM=HS256 # JWT 算法
MCP_TOKEN_MAX_EXPIRY=7776000 # Token 最大有效期(秒),默认 90 天
MCP_ADMIN_API_PREFIX=/admin # 管理 API 路由前缀kubeconfig 管理
系统会将 kubeconfig 文件保存在 data/kubeconfigs/ 目录下,支持:
多集群配置管理
配置文件的增删改查
集群间快速切换
自动加载默认集群配置
自动加载功能
系统提供智能的配置自动加载机制:
默认集群:设置一个集群为默认集群后,所有工具都会自动使用该集群的配置
默认命名空间:每个集群可以设置默认的命名空间
参数优先级:明确指定的参数 > 默认集群配置 > 系统默认值
这意味着您可以:
导入集群配置一次,后续无需每次指定 kubeconfig
大部分操作无需指定任何参数,直接使用默认配置
🔍 依赖说明
核心依赖
mcp: MCP Python SDK 与 FastMCP Server API
kubernetes: Kubernetes Python 客户端库
pyyaml: YAML 配置文件解析
pydantic: 数据验证和序列化
uvicorn: ASGI 服务器
特别说明
❌ 不依赖 kubectl:本项目完全通过 Kubernetes Python Client API 实现,无需安装 kubectl 命令行工具
✅ 仅需 kubeconfig:只需要有效的 kubeconfig 文件即可连接和管理 Kubernetes 集群
🚀 高级功能
集群健康监控
系统提供全方位的集群健康检查:
节点状态监控
系统 Pod 健康检查
API 服务器连通性检查
资源使用率分析
事件日志收集
资源分析
提供详细的资源使用分析:
CPU/内存请求和限制统计
集群资源利用率计算
资源优化建议
多集群管理
支持管理多个 Kubernetes 集群:
集群配置存储和管理
快速切换集群上下文
集群列表和状态展示
默认集群自动加载
集群连接测试和验证
智能配置系统
提供完整的配置管理体系:
自动发现:自动加载默认集群和命名空间配置
参数简化:大部分操作无需指定冗余参数
配置验证:完整的 kubeconfig 格式验证
错误处理:友好的错误提示和自动回退机制
优雅删除机制
支持 Kubernetes 标准的优雅删除:
grace_period_seconds: 设置优雅关闭等待时间
立即删除: 设置为 0 实现强制删除
默认行为: 使用 Kubernetes 默认的优雅删除策略
📚 开发指南
添加新工具
在对应的工具模块中添加函数
使用
@mcp.tool装饰器通过
KubernetesAPIService进行 API 调用
示例:
@mcp.tool()
async def my_new_tool(kubeconfig_path: str = None, namespace: str = "default") -> str:
"""新工具描述"""
try:
from services.factory import get_k8s_api_service
from utils.response import json_success, json_error
k8s_service = get_k8s_api_service(kubeconfig_path) # 按 kubeconfig_path 缓存
result = await k8s_service.some_api_call(namespace=namespace)
return json_success({"data": result})
except Exception as e:
return json_error(str(e))扩展 API 服务
在 services/k8s_api/ 的相应 Mixin 模块(如 pod_ops.py、workload_ops.py)中添加新的 API 方法:
async def new_api_method(self, param1: str, grace_period_seconds: int = None) -> Dict[str, Any]:
"""新的 API 方法"""
try:
# 支持优雅删除
body = client.V1DeleteOptions(grace_period_seconds=grace_period_seconds) if grace_period_seconds is not None else None
# 使用 self.v1_api, self.apps_v1_api 等进行 API 调用
result = self.v1_api.some_kubernetes_api(body=body)
return self._format_result(result)
except ApiException as e:
raise Exception(f"API 调用失败: {e.reason}")🚀 快速入门指南
1. 导入集群配置
# 启动服务
k8s-mcp-server
# 在 MCP 客户端中导入集群
import_cluster(
name="生产环境",
kubeconfig="/path/to/kubeconfig.yaml",
namespace="default",
is_default=True
)2. 使用自动加载功能
一旦设置了默认集群,所有操作都可以简化:
# 批量列出 Pod(自动使用默认集群和命名空间)
batch_list_resources(resource_types="pods", namespace="default")
# 查看集群信息
get_cluster_info()
# 检查集群健康状态
check_cluster_health()
# 批量创建资源(含 Deployment)
batch_create_resources(resources="[{...}]", namespace="default")3. 管理多集群
# 查看所有集群
list_clusters()
# 切换默认集群
set_default_cluster(name="测试环境")
# 测试集群连接
test_cluster_connection(name="生产环境")4. 多租户认证(可选)
适用于团队/线上多人使用场景。
# 1. 启动服务(启用认证)
MCP_AUTH_ENABLED=true MCP_JWT_SECRET=your-secret-key \
k8s-mcp-server --transport streamable --host 0.0.0.0 --port 8000
# 2. 生成管理员 Token
MCP_JWT_SECRET=your-secret-key mcp-admin bootstrap
# 输出:MCP_BOOTSTRAP_ADMIN_JWT=eyJhbGci...
# 3. 为用户签发 Token
MCP_JWT_SECRET=your-secret-key mcp-admin issue --user alice --expires 7776000
# 4. 通过 MCP Tool 为用户分配集群权限(管理员在 MCP 对话中执行)
# admin_manage_users(action="grant_access", user_id="alice",
# cluster_name="prod", namespace="default", profile="developer")用户在 MCP 客户端配置 Token(以 Cursor 为例):
{
"mcpServers": {
"k8s-mcp-server": {
"url": "http://your-server:8000/mcp",
"headers": {
"Authorization": "Bearer eyJhbGci..."
}
}
}
}权限 Profile
Profile | 可见工具 | K8s 权限 | 管理能力 |
| 13 个(只读 + 日志 + 连接测试 + 切换集群) | get/list/watch + pods/log | — |
| 21 个(读写 + exec) | CRUD 工作负载 + pods/log、exec、portforward | — |
| 30 个(+ 备份恢复、集群诊断、节点排水、用户管理) | 命名空间全操作 + rbac 只读 + ClusterRole(nodes/namespaces/events/metrics/drain) | 可管理 viewer/developer 用户 |
| 35 个(全部,含集群级操作) | 使用 K8s admin kubeconfig,天然集群全权限 | 全部 |
安全机制
路径注入防护:
kubeconfig_path仅允许指向当前用户自己的数据目录,阻止跨用户读取输入校验:
user_id、cluster_name、namespace等标识符强制格式校验(字母数字、连字符、下划线、点),防止路径穿越operator 权限隔离:operator 不能自我授权、不能操作高权限用户、不能签发 admin token。operator 自身的 K8s 操作权限限定在被授权的命名空间内,但其用户管理能力(
grant_access)属于 MCP 平台级委派,可跨命名空间为用户分配 viewer/developer 权限(底层使用 admin kubeconfig 创建 RBAC),适合作为平台维护人员统一管理多团队接入自定义 Profile 限制:自定义 profile 不允许包含
user_manage/profile_manage/cluster_ops保留分类或管理工具Token 有效期上限:默认最大 90 天(可通过
MCP_TOKEN_MAX_EXPIRY调整)撤销列表自动清理:过期的 jti 会自动从撤销表中移除,防止无限增长
审计日志:所有管理操作(签发/撤销 Token、授权/撤销集群权限)均记录到
operations.logOperator RBAC 代理:operator 调用
grant_access时自动使用 admin 的高权限 kubeconfig 创建 K8s RBAC 资源ClusterRole 联动:operator profile 的
grant_access额外创建 ClusterRole + ClusterRoleBinding(nodes、namespaces、events、metrics、pods/eviction),revoke_access同步清理集群级工具优雅降级:
get_cluster_info对无集群级权限的用户返回部分结果(跳过 nodes/namespaces);get_cluster_events在 ns=all 失败时提示指定命名空间;test_cluster_connection使用 VersionApi 无需集群级权限K8s 服务缓存失效:
grant_access/revoke_access执行后自动失效目标用户的 K8s 客户端缓存,避免旧 token 被后续请求复用;test_cluster_connection测试前自动失效该集群缓存并从磁盘重载 kubeconfigimport_cluster 证书校验:导入时自动校验客户端证书与私钥是否匹配(
ssl.SSLContext.load_cert_chain),不匹配立即拒绝并返回含curl文件上传指引的错误信息。直接传入 kubeconfig 内容是支持的,但部分 AI 模型在生成 tool call 参数时会损坏长 base64 字符串导致校验失败;此时错误信息会引导使用POST /admin/kubeconfigs/upload上传文件后再以服务端路径导入,绕过 LLM 文本生成环节RBAC 模板即时同步:
grant_access使用 K8s API 直接创建/替换 Role,确保模板变更立即生效,无需手动删除旧 Role端口转发线程隔离:port_forward 使用独立的 ApiClient 实例,避免 monkey-patch 污染共享 API 客户端
Tar slip 防护:从 Pod 拷贝文件时校验 tar 成员路径,防止路径穿越写入目标目录之外
管理 REST API
端点 | 方法 | 说明 |
| POST | 签发 Token |
| POST | 延长 Token 实际生效时间(token 字符串不变,body: |
| POST | 撤销 Token |
| GET | 查看撤销列表 |
| POST | 清理撤销列表与延期表中已过期记录 |
| GET | 列出所有用户 |
| POST | 上传 kubeconfig 文件(供 |
CLI 管理工具
mcp-admin bootstrap # 生成管理员 Token
mcp-admin issue --user bob # 签发用户 Token
mcp-admin extend --jti xxx --expires 7776000 # 延期单个 token(token 字符串不变;user_id == 'admin' 不可延期)
mcp-admin extend --user bob --expires 7776000 # 延期该用户最近的一个 token
mcp-admin migrate-extensions [--dry-run] # 把 user_grants.json 里 active grant 迁入延期表(排除 user_id == 'admin',幂等)
# 启动时仅在 token_extensions.json 不存在时自动迁移一次;后续新增用户需运行 --overwrite 补齐
mcp-admin revoke --jti xxx # 撤销单个 Token
mcp-admin revoke-user --user bob # 撤销用户全部 Token
mcp-admin list-users # 列出所有用户(含 extended_tokens 计数)
mcp-admin grant --user bob --cluster prod --namespace default --profile developer # 分配权限
mcp-admin revoke-access --user bob --cluster prod --namespace default # 撤销权限
mcp-admin list-profiles # 列出所有 Profile未激活虚拟环境时可使用
uv run mcp-admin ...临时运行。
5. 容器化部署
# 构建并部署到 Kubernetes
docker build -t k8s-mcp-server:latest .
kubectl apply -f k8s/
# 查看部署状态
kubectl get pods -l app=k8s-mcp-server
kubectl logs -f deployment/k8s-mcp-server🔄 更新说明
最新版本特性
✅ 35 个工具函数:涵盖所有主要 Kubernetes 资源(含 CRD 动态发现)
✅ 优雅删除支持:部分删除函数支持
grace_period_seconds参数✅ 容器化支持:提供 Docker 和 Kubernetes 部署
✅ 数据持久化:支持配置、用户操作日志及 Pod 拷贝文件(data/copyfiles)的持久化存储
✅ 健康检查:提供完整的健康检查机制
✅ 多集群管理:支持多集群配置和快速切换
✅ 批量操作:支持集群所有可发现 API 资源的批量操作,包含事务回滚
✅ 发布管理:支持 Deployment/StatefulSet/DaemonSet 的 status、undo(含指定 revision)、pause、resume
✅ 资源监控:batch_top_resources 查看 Node/Pod CPU、内存使用(依赖 metrics-server)
✅ Pod 文件读写:copy_pod_files 支持 Pod 文件双向传输,支持
local_path直接落盘(二进制自动解码,无中间 base64 文件)✅ 多租户认证:JWT 认证、权限 Profile 分级、Tool 可见性过滤、K8s RBAC 自动联动、输入校验与审计日志
✅ 备份恢复:支持命名空间和资源级别的备份恢复
✅ 变更验证预览:自动验证所有写操作,显示具体变更内容和操作风险
✅ 交互式操作:支持 Pod 命令执行、端口转发(含启停管理)、日志(含 previous 上一实例)
✅ 多集群 kubeconfig:batch、backup、rbac 等工具均支持
kubeconfig_path参数指定目标集群
⚠️ 注意事项
CronJob 兼容性说明
❌ 本项目(k8s-mcp-server)不支持 batch/v1beta1 CronJob API。
✅ 仅适用于 Kubernetes v1.25 及以上版本(即只支持 batch/v1 版本的 CronJob 资源)。
⏫ 如果你的集群版本低于 v1.25,或仍在使用 batch/v1beta1,请升级集群或手动迁移 CronJob 资源。
🧪 回归测试
# 运行全部回归测试(需可用的 K8s 集群)
python -m tests.regression_test
# 仅运行同步测试(无需集群)
REGRESSION_SKIP_ASYNC=1 python -m tests.regression_test同步测试(7 个):导入、资源构建器、参数解析、kubeconfig 验证、tools 导出等
异步测试(30 个):覆盖 MCP 工具的实际调用,需集群连接
备份测试隔离:
backup_namespace、backup_resource的回归测试使用临时目录,测试后自动删除,不影响正式备份数据
🤝 贡献
欢迎贡献代码!请确保:
遵循现有的代码风格
添加适当的错误处理
更新相关文档
添加测试用例
支持优雅删除机制(如适用)
📄 许可证
MIT License - 详见 LICENSE 文件
Available Tools
32 toolsbackup_namespaceC
备份命名空间
Args: namespace: 命名空间名称 cluster_name: 集群名称(可选) include_secrets: 是否包含 Secret 资源,默认 True kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | ||
| cluster_name | No | ||
| include_secrets | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of disclosing behavioral traits. It mentions 'include_secrets' defaults to True, which implies secrets are backed up by default, and explains kubeconfig fallback logic. However, it does not state whether the operation is read-only, where the backup is stored, whether it overwrites existing backups, or what permissions are required. This significant gap is particularly concerning for a backup operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a compact parameter list with a one-line purpose prefix. It is free of filler and gets straight to the point, making it easy to scan. The structure is consistent and each parameter is given a brief explanation. It loses a point for not using a more standard prose format that could have integrated usage context more smoothly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description must explain the tool's full behavior, but it only covers parameter semantics. It fails to describe what a backup actually produces, how it is stored, how to restore it, or what the expected side effects are. For a 4-parameter operation on a Kubernetes namespace, this is incomplete and leaves many critical questions unanswered.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The overall schema has 0% description coverage, so the description is the only source of parameter meaning. It provides useful semantics for 'include_secrets' (whether Secret resources are included, default True) and 'kubeconfig_path' (fallback to cluster_name or default cluster if not set). However, 'namespace' and 'cluster_name' are nearly tautological ('命名空间名称', '集群名称(可选)') and add little beyond the property names. Overall, it compensates partially for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with '备份命名空间' (backup namespace), which directly restates the tool name and gives a verb+resource. However, it never explains what the backup entails (e.g., snapshot, export YAML, archive), nor does it distinguish this tool from the sibling 'backup_resource' or 'restore_from_backup'. The scope is implied by the name but not stated explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives. The description only lists parameters and their defaults. It does not mention when a namespace-level backup is appropriate, when to prefer 'backup_resource' for individual resources, or any prerequisites such as cluster connectivity. This leaves the agent to infer usage solely from the tool name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
backup_resourceA
备份特定资源
Args: resource_type: 资源类型(deployment, service, configmap等) resource_name: 资源名称 namespace: 命名空间 cluster_name: 集群名称(可选) kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | ||
| cluster_name | No | ||
| resource_name | Yes | ||
| resource_type | Yes | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full behavioral disclosure. It only states the action and lists parameters, but does not disclose what the backup operation produces, where it stores backups, whether it is destructive, what errors may occur, or any permission requirements. This is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loaded with a clear purpose statement, and uses a clean list format for parameters. It wastes no words, though it repeats parameter names that also appear in the schema; the additional Chinese explanations justify their presence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is moderately simple, but the description lacks information about output format, error handling, or relationship to the sibling backup_namespace tool. With no output schema or annotations, the description should explain more about the backup's result and behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has no descriptions for parameters, so the description's Args section provides essential semantics—resource_type lists examples, kubeconfig_path explains fallback behavior, and cluster_name is noted as optional. This adds substantial meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool backs up specific resources (备份特定资源), with the verb 'backup' and resource type parameters. It distinguishes from sibling backup_namespace by explicitly focusing on individual resources rather than whole namespaces.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by listing the resource types (deployment, service, configmap) and the optional cluster parameters. It clearly implies this is for backing up a specific resource, distinct from namespace-level backup, though it does not explicitly name the alternative tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_create_resourcesA
批量创建资源
Args: resources: JSON格式的资源列表,每个资源包含kind、metadata、spec namespace: 命名空间 rollback_on_failure: 失败时是否回滚已创建的资源 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| resources | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No | ||
| rollback_on_failure | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are absent, so the description carries the transparency burden. It discloses the rollback_on_failure behavior and the priority between kubeconfig_path and cluster_name. However, it does not mention idempotency, error handling side effects, or whether the operation is atomic beyond the rollback option. These are notable gaps for a batch mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a compact, front-loaded docstring with a one-line summary followed by a bulleted parameter list. Every line adds value, and the formatting is easy to scan. No redundancy or filler exists.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description should explain what the tool returns or how success/failure is reported. It does not. It also lacks error condition descriptions, making it incomplete for a batch operation that could partially fail. The rollback parameter hints at failure semantics but does not describe the final state feedback.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so parameter explanations in the description are critical. It adds meaning for all five parameters: defines resources as a JSON list with kind, metadata, spec; explains rollback_on_failure; and clarifies the precedence between kubeconfig_path and cluster_name. This fully compensates for the barren schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description begins with '批量创建资源' which clearly states a batch create operation for resources. This distinguishes it from sibling tools like batch_update_resources and batch_delete_resources based on the verb. However, it lacks detail on the scope or method of creation, so it does not fully elaborate the purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives such as batch_update_resources or individual create tools. It does not mention prerequisites like cluster connectivity, nor does it specify whether it should be used for initial creation only. The parameter list implies usage but gives no explicit context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_delete_resourcesB
批量删除资源
Args: resources: JSON格式的资源列表 namespace: 命名空间 grace_period_seconds: 优雅删除等待时间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| resources | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No | ||
| grace_period_seconds | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full responsibility for behavioral disclosure. It hints at Kubernetes deletion semantics via 'grace_period_seconds' (优雅删除等待时间) and explains cluster selection logic, but it does not state that deletion is destructive, irreversible, or what permissions are required. This is a critical gap for a batch delete operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a compact docstring: a one-line purpose followed by a parameter list. It is front-loaded with the action and each parameter gets a short, useful explanation. No filler or redundant text, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This destructive tool has no annotations and no output schema. The description only covers parameter syntax and omits important context such as return values, error handling, safety warnings, and behavioral impact. For a batch delete operation with five parameters, this is insufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema coverage, the description adds meaningful explanations for all five parameters. For example, 'resources' is described as a JSON-format resource list, and the interplay between kubeconfig_path and cluster_name is clarified ('不指定则使用 cluster_name 或默认集群'). This goes beyond the schema titles, though details like the exact format of the resource list remain vague.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '批量删除资源' (batch delete resources) clearly identifies the action (delete) and target (resources). The parameter list with 'resources', 'namespace', and 'grace_period_seconds' distinguishes it from sibling batch operations. However, it doesn't specify exactly which resource types are supported, leaving a minor ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives like batch_update_resources or batch_create_resources. No prerequisites, exclusions, or alternative recommendations are provided. The description only lists parameters without context on use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_describe_resourcesA
批量获取资源详细信息
Args: resource_specs: 资源规格列表,格式:[{"kind": "Pod", "name": "my-pod"}, {"kind": "Service", "name": "my-svc"}] namespace: 命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 批量资源详细信息
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| cluster_name | No | ||
| resource_specs | Yes | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. It states it retrieves detailed info, which implies read-only, but does not explicitly mention that it does not modify resources, what permissions are required, how errors are handled, or what happens if a resource is not found. Beyond the inherent 'get' semantics, it adds little about behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description uses a clear structured format (summary, Args, Returns). The parameter explanations are concise and the format example is warranted. It is slightly longer than strictly necessary but every sentence contributes to understanding. The summary is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description should explain the return format more precisely. It only says '批量资源详细信息' (batch resource detailed info) without describing structure, pagination, or error behavior. Also, no guidance on cluster selection when both kubeconfig_path and cluster_name are absent, or about cluster_name needing clusters.json. Overall, the completeness is insufficient for a moderately complex batch tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description's Args section significantly explains each parameter. It provides a concrete format example for resource_specs, explains the relationship between kubeconfig_path and cluster_name, and clarifies the meaning of namespace. Since the schema has no property descriptions (0% coverage), this description fully compensates and adds substantial meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '批量获取资源详细信息' (batch get resource detailed information), with the verb '获取' (get) and resource '资源' (resources). This distinguishes it from sibling tools like batch_list_resources, batch_create_resources, etc., which are explicitly named for different operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides conditional usage context: kubeconfig_path is used if specified, otherwise cluster_name or the default cluster is used. However, it does not explicitly say when to choose this tool over alternatives like batch_list_resources or get_cluster_info. The batch prefix implies usage for multi-resource operations, but no exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_list_resourcesB
批量查看资源
Args: resource_types: 资源类型,支持:1) "all" 列出集群所有可用 API 资源类型;2) JSON 数组如 ["pods","deployments"];3) 单个类型如 "pods"。支持任意集群内可发现的资源(含 CRD) namespace: 命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 批量查看结果
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| cluster_name | No | ||
| resource_types | Yes | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry the full behavioral disclosure burden. It explains parameter precedence (kubeconfig_path vs cluster_name) and resource_types formats, but it fails to disclose return value structure, pagination, error handling, permission requirements, or whether the operation is read-only. The Returns line '批量查看结果' is tautological and adds no behavioral insight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a one-sentence summary followed by Args/Returns sections. The resource_types explanation is detailed but necessary given the parameter's complexity. However, the Returns line is vague and could be replaced with concrete output details, slightly reducing value per sentence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations and no output schema, the description leaves critical gaps: the return value is unspecified beyond 'batch view results', and there is no mention of pagination, errors, or permissions. While parameter semantics are solid, the overall behavioral contract is under-specified, making the description sufficient only as a minimal functional overview.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description is the only source of parameter semantics. It thoroughly explains resource_types with three supported formats and CRD support, and clarifies the relationship and precedence between kubeconfig_path and cluster_name. namespace is only labeled, but its meaning is obvious. This significantly compensates for the missing schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '批量查看资源' clearly indicates a batch listing operation, and the tool name 'batch_list_resources' reinforces this. It is distinguishable from sibling batch_create/update/delete tools by the verb 'list/view', but it does not explicitly differentiate from batch_describe_resources or other read-only tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool versus alternatives. It does not mention exclusions or reference sibling tools like batch_describe_resources for detailed descriptions. The only implied usage is the bare phrase 'batch view resources', which is insufficient for selecting among the many batch_* and read-oriented tools in the cluster.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_restart_resourcesB
批量重启资源
Args: resources: JSON格式的资源列表,格式:[{"kind": "Deployment", "name": "my-app"}, {"kind": "StatefulSet", "name": "my-db"}] namespace: 命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 批量重启结果
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| resources | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must explain behavioral traits. It only says 'batch restart results' without detailing what a restart entails (e.g., rolling restart, pod deletion, readiness checks), potential side effects, or required permissions. This is a significant gap for a mutating operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with a clear heading, Args, and Returns sections. It is reasonably concise and all listed parameter explanations are useful, though the Returns line is somewhat vague and could be omitted or expanded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While parameter details are well covered, the tool description lacks behavioral context, output details, and usage scenarios. For a batch mutation tool with no annotations or output schema, the description should disclose more about the restart mechanism and potential impact to be complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage and resources is just a string, but the description compensates well by explaining the JSON format with a concrete example, the namespace default, and the precedence between kubeconfig_path and cluster_name. This goes beyond the schema and adds critical usage detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '批量重启资源' (batch restart resources), identifying the action and target resource type. It provides the expected input format and parameters, but does not explicitly distinguish itself from sibling tools like batch_rollout_resources, which may also handle restarts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives such as batch_rollout_resources or batch_delete_resources. It merely lists arguments without explaining the intended use case or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_rollout_resourcesA
批量发布操作:查看状态、回滚、暂停、恢复
Args: operations: JSON 数组,每项格式 {"kind":"Deployment","name":"xxx","action":"status|undo|pause|resume","revision":3} action: status 查看发布状态, undo 回滚(不指定 revision 则回滚到上一版本, 指定 revision 则回滚到该版本), pause 暂停(仅Deployment), resume 恢复(仅Deployment) namespace: 命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 批量操作结果
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| operations | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It explains rollback behavior (without revision rolls back to previous, with revision rolls to that version), notes that pause/resume apply only to Deployments, and clarifies kubeconfig_path vs cluster_name precedence. This is good transparency, though it doesn't mention permissions or failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args and Returns sections. Each sentence provides necessary information without repetition or fluff. It is appropriately sized for the complexity of the tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 4 parameters, no output schema, and no annotations, the description covers all parameters and actions in sufficient detail. It lacks specification of the return result structure or error conditions, but the core usage is complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It thoroughly documents the operations parameter with its JSON structure, each action's semantics, and the revision field. It also explains namespace, kubeconfig_path, and cluster_name meanings. The only minor issue is that the schema types operations as a string, while the description shows it as a JSON array without clarifying how the string is encoded.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it performs batch rollout operations with specific actions: status, rollback, pause, and resume. It names the resource type (Deployment) and the exact operations, distinguishing it from sibling tools like batch_list_resources or batch_delete_resources. This meets the 'specific verb+resource' benchmark.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by listing actions and the operation format, but it does not explicitly state when to use this tool over alternatives or provide when-not-to-use guidance. For example, it doesn't compare with batch_update_resources or batch_restart_resources, so guidance is only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_top_resourcesA
批量查看 Node/Pod 的 CPU、内存使用(类似 kubectl top)
Args: resource_types: 资源类型,JSON 数组如 ["nodes","pods"] 或 "nodes" 或 "pods" namespace: 命名空间(仅对 pods 有效) kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: nodes 和/或 pods 的 CPU、内存使用数据。依赖集群已部署 metrics-server。
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| cluster_name | No | ||
| resource_types | Yes | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses key behavioral traits: the dependency on metrics-server ('依赖集群已部署 metrics-server'), the fallback logic for kubeconfig_path (if not specified, uses cluster_name or default cluster), and the namespace constraint ('仅对 pods 有效'). These add valuable context beyond the schema and imply a read-only operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a one-line summary followed by clearly labeled Args and Returns sections. Each sentence contributes necessary information without redundancy. It is appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only metrics tool with no annotations or output schema, the description covers the essential aspects: purpose, all parameters, return data, and a critical dependency. It lacks details on return data structure or error handling, but these are less critical for this simple batch query. Overall, it is complete enough for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description compensates fully by explaining every parameter: resource_types (with JSON format examples), namespace (with pod-only constraint), kubeconfig_path (with fallback behavior), and cluster_name (with source and precedence). This adds significant meaning beyond the bare schema fields, making it easy for an agent to construct valid inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: '批量查看 Node/Pod 的 CPU、内存使用' (batch view CPU/memory usage of Node/Pod), which is a specific verb+resource combination. It distinguishes itself from siblings like get_cluster_resource_usage by focusing on batch node/pod-level metrics, similar to kubectl top. This is unambiguous and specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context via '类似 kubectl top' and parameter constraints, but it does not explicitly state when to use this tool versus alternatives like get_cluster_resource_usage. It lacks explicit exclusions or alternative mentions, but the context is reasonably clear. This earns a 3 for implied usage without explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
batch_update_resourcesC
批量更新资源
Args: resources: JSON格式的资源列表 namespace: 命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | default | |
| resources | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not explain side effects, idempotency, atomicity, error behavior, or what happens to existing resources. The only behavioral trait mentioned is the kubeconfig fallback logic, which is insufficient for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured, with a single-sentence summary followed by parameter details. There is no filler or redundant information. Each line serves a purpose, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
As a mutation tool with no annotations and no output schema, this description is incomplete. It omits return values, error handling, resource type support, and how updates are applied. The parameter documentation is helpful, but the operational context is largely absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context to the parameters. It clarifies that 'resources' is a JSON-formatted list, and it explains the fallback relationship between kubeconfig_path and cluster_name. With schema description coverage at 0%, this significantly compensates for the bare schema. The namespace explanation is minimal, but overall it adds value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states '批量更新资源' (batch update resources), which is a clear verb+resource combination. However, it is essentially a restatement of the tool name and lacks detail on what 'update' entails (e.g., patch vs replace). It only minimally distinguishes from sibling batch tools like batch_create or batch_delete.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives such as batch_create or batch_delete. No prerequisites, exclusions, or contextual scenarios are provided. The parameter list offers fallback logic but no usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_cluster_healthA
检查Kubernetes集群健康状态,可选附带 RBAC 权限冲突检测
Args: kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用 include_rbac_check: 是否同时检查 RBAC 权限冲突(如重复绑定、冗余权限),默认 False rbac_namespace: RBAC 检查的目标命名空间,仅 include_rbac_check=True 时有效;省略则检查所有系统命名空间
Returns: 集群健康检查结果(含可选 RBAC 冲突报告)
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_name | No | ||
| rbac_namespace | No | ||
| kubeconfig_path | No | ||
| include_rbac_check | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It explains parameter behavior (defaults, conditional applicability) and indicates the return type, but does not explicitly state whether the operation is read-only, requires specific permissions, or what constitutes a health check.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with purpose, Args, and Returns sections, each concise. The docstring format is slightly verbose but every sentence provides necessary detail without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers the essential context: purpose, parameters, and return value. With no annotations or output schema, it could be more detailed about the result structure and potential side effects, but is adequate for a health-check tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description compensates fully by explaining each parameter's purpose, default, and inter-dependencies (e.g., rbac_namespace only when include_rbac_check is True, kubeconfig_path vs cluster_name precedence).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states a specific action: check Kubernetes cluster health, optionally with RBAC conflict detection. This distinguishes it from sibling tools like check_node_health and check_pod_health by focusing on cluster-level and the unique RBAC feature.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the purpose (check health), but no explicit guidance on when to use this over sibling health tools like check_node_health or check_pod_health, nor 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.
check_node_healthB
检查节点健康状态
Args: node_name: 节点名称,如果不提供则检查所有节点 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 节点健康状态报告
| Name | Required | Description | Default |
|---|---|---|---|
| node_name | No | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavioral traits. It mentions that omitting node_name checks all nodes and describes kubeconfig fallback logic, but it does not disclose whether the operation is read-only, if it requires special permissions, or what the health report contains. This is minimal transparency for a tool that could potentially affect cluster state or take time.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args and Returns sections, and each parameter explanation is concise. It is not overly verbose, though it could be tightened by removing the REST-style parameter block since the schema already lists the fields, but the extra details are useful given the lack of schema descriptions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a health-check tool with no output schema and no annotations, the description covers the action, parameters, and return type. However, it lacks details on the format of the health report, any prerequisites, and potential side effects, leaving some gaps for an agent to fully understand the tool's behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, but the description compensates by explaining all three parameters: node_name, kubeconfig_path, and cluster_name, including their default behaviors and fallback relationships. This adds significant meaning beyond the bare schema fields.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '检查节点健康状态' (check node health status), which is a specific verb+resource combination. It distinguishes itself from sibling tools like check_cluster_health and check_pod_health by focusing on nodes, and the title of the tool matches the action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives such as check_cluster_health or check_pod_health. It does not mention any exclusions or preferred contexts, leaving the agent to infer usage solely from the tool name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_pod_healthA
检查Pod健康状态,支持筛选失败的Pod
Args: pod_name: Pod名称,如果不提供则检查命名空间中的所有Pod namespace: Kubernetes命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用 only_failed: 是否只返回失败或异常的Pod,默认为False limit: 当检查命名空间内所有 Pod 时,最多处理的 Pod 数量,默认 100,避免大量 Pod 时过慢
Returns: Pod健康状态报告,包含失败Pod筛选功能
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| pod_name | No | ||
| namespace | No | default | |
| only_failed | No | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses defaults (namespace, only_failed, limit) and that limit avoids slowness with many Pods, but it does not explicitly state read-only behavior, what health criteria are used, or any permission requirements. A health check implies non-destructive action, but the implications are not made explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose, then uses a clean Args list for parameters and a Returns line. Each bullet adds necessary information without fluff, making it easy to scan and parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description covers all parameters and core behavior but the Returns statement is vague ('Pod健康状态报告' - Pod health status report). It does not specify what fields or status values will be included, so an agent cannot predict the report structure precisely. Still, the essential execution context is covered.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, but the Args block explains all 6 parameters with meaningful semantics: pod_name optional, namespace default, kubeconfig_path fallback to cluster_name, only_failed default False, and limit default 100 with rationale. This fully compensates for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with a specific verb and resource: '检查Pod健康状态' (check Pod health status), clearly distinguishing it from sibling tools like check_cluster_health and check_node_health. It also mentions a distinct capability, '支持筛选失败的Pod' (supports filtering failed Pods).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly establishes when to use the tool by naming the resource (Pod health) and using namespace/cluster parameters. It does not explicitly mention alternative tools or when-not-to-use scenarios, but the context is clear enough for an agent to select it over cluster/node health checks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
copy_pod_filesA
Pod 与 MCP 客户端之间拷贝文件
Args: pod_name: Pod 名称 direction: 拷贝方向,"from_pod" 读取 Pod 文件内容,"to_pod" 将内容写入 Pod pod_paths: from_pod 时为 Pod 内文件路径(JSON 数组或单个路径,支持目录);to_pod 时为 Pod 内目标文件路径 content: to_pod 时必填(local_path 未指定时),要写入 Pod 的文件内容 encoding: to_pod 时 content 的编码方式,"text"(默认)或 "base64"(二进制文件) local_path: 本地文件路径。from_pod 时指定则直接将解码后的文件保存到此目录(二进制文件不再需要中间 base64 文件);to_pod 时指定则从此本地文件读取内容写入 Pod namespace: 命名空间,默认为 default container: 容器名称,多容器 Pod 需指定 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: from_pod: 文件内容或本地保存路径; to_pod: 写入确认
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| encoding | No | text | |
| pod_name | Yes | ||
| container | No | ||
| direction | Yes | ||
| namespace | No | default | |
| pod_paths | Yes | ||
| local_path | No | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and covers it well: it explains direction-specific behavior, encoding for binary files, how local_path changes the flow, and return values. It also notes that to_pod file writes are confirmed and from_pod returns content or a saved path.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a one-line purpose, then uses a structured Args list and a Returns note. Every sentence adds value, and the information density is high without being verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 10-parameter, two-direction file-copy tool with no output schema, the description covers all essential behavior: parameter meanings, direction logic, encoding, defaults, container selection, and return values. It is self-sufficient for an agent to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description compensates by explaining every parameter, including conditional requirements (content is required when local_path is not specified), defaults (namespace=default, encoding=text), and formats (pod_paths as JSON array or single path). This goes far beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action: copy files between a Pod and the MCP client, and the Args section defines both directions (from_pod/to_pod). This clearly distinguishes it from siblings that inspect logs, execute commands, or manage clusters.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The Args give explicit usage conditions: direction values, when content is required, local_path alternatives, namespace default, multi-container requirement, and kubeconfig fallback logic. It does not explicitly mention when to avoid this tool in favor of a sibling, but the context is otherwise clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_clusterC
删除集群配置
Args: name: 集群名称
Returns: 删除结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are absent, so the description carries full responsibility. It mentions 'delete' but does not disclose side effects, reversibility, permission requirements, or whether this affects the live cluster or just its configuration. The distinction between 'delete cluster' and 'delete cluster configuration' is ambiguous, and no safety hints are provided.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and well-structured, with an action line, explicit Args and Returns sections. Every word serves a purpose, and the format is easy to parse. It is not verbose or redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite the tool's simplicity, the description lacks essential context for a destructive operation. There is no output schema, and the return value is only '删除结果' (deletion result) without details. It fails to clarify the scope of deletion, making it incomplete for an agent to safely invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description compensates minimally by stating that 'name' is the cluster name. This adds semantic meaning beyond the bare property name, but it does not provide format constraints, examples, or how to obtain the name. For a single required parameter, it is adequate but not rich.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('删除集群配置' = delete cluster configuration) with a clear verb and resource. It distinguishes from siblings by focusing on cluster deletion rather than listing, importing, or getting info, though it does not explicitly differentiate from delete_kubeconfig or batch_delete_resources.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, whether to prefer this over delete_kubeconfig for specific cases, or any context for when deletion is appropriate. The usage is only implied by the verb 'delete'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_kubeconfigC
删除kubeconfig文件
Args: name: 配置名称
Returns: 删除结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden for behavioral disclosure. It says 'delete' which implies destructive action, but it does not explain consequences, reversibility, required permissions, or effects on cluster connections. The 'Returns: 删除结果' is vague and does not clarify outcome details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short and structured with Args/Returns sections. It is efficient and contains no fluff. For such a simple tool, the size is appropriate, though it may be under-specified. It earns a high score for conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description should compensate by explaining return values and side effects. It only says '删除结果' (deletion result), which is unhelpful. Also missing are potential errors, whether deletion is permanent, and what 'name' refers to in practice. The description is incomplete for a destructive operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one required parameter 'name' with no description, and schema coverage is 0%. The description adds 'Args: name: 配置名称' which translates to 'configuration name', providing a minimal clarification. However, this only restates the parameter's existing title and does not explain what kind of name, format, or examples are expected.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states '删除kubeconfig文件' which clearly indicates deleting a kubeconfig file. However, it is very close to the tool name and does not add scope or differentiation from related operations like load_kubeconfig or list_kubeconfigs. It is a clear verb+resource statement but lacks sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, side effects, or conditions under which deletion is appropriate. The description only states the action and arguments, offering no usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
exec_pod_commandA
在Pod中执行命令
Args: pod_name: Pod名称 command: 要执行的命令列表,如 ["ls", "-la"] namespace: Kubernetes命名空间,默认为default container: 容器名称,如果Pod有多个容器则需要指定 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 命令执行结果
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| pod_name | Yes | ||
| container | No | ||
| namespace | No | default | |
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states that it executes a command and returns the result, but does not mention potential side effects (e.g., command may modify the pod or cluster), permission requirements, interactivity, or any safety caveats. This is a significant gap for an arbitrary command execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with labeled sections (Args, Returns) and each parameter is on its own line. It is appropriately sized for the tool's complexity, though a few elements (like repeating the parameter names in the schema) are redundant. No unnecessary fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all six parameters, including defaults and optionality, and states that the return value is the command execution result. It does not detail error handling, output format, or edge cases (e.g., what happens if the pod has multiple containers and none is specified), but the core information needed to invoke the tool is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description provides detailed semantics for every parameter, including an example for 'command' (e.g., ["ls", "-la"]), defaults for 'namespace' (default) and 'container' (must specify if multi-container), and the interaction between 'kubeconfig_path' and 'cluster_name'. This fully compensates for the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to execute a command inside a Kubernetes Pod ('在Pod中执行命令'). This uses a specific verb ('execute') and resource ('Pod'), distinguishing it from sibling tools like getting logs, copying files, or port-forwarding.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is implied by the purpose and the parameter list (e.g., namespace, container). However, there is no explicit statement about when to choose this tool over alternatives, nor any exclusions or preconditions. The tool's name and description make its primary use obvious, but no comparative guidance is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cluster_eventsA
获取集群事件
Args: namespace: Kubernetes命名空间,"all"表示所有命名空间 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用 event_type: 事件类型过滤(Warning, Normal等) limit: 返回事件数量限制
Returns: 集群事件列表
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| namespace | No | all | |
| event_type | No | ||
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of disclosing behavior. It reveals that the operation is a read (get), explains namespace filtering semantics, and clarifies cluster selection fallback logic. However, it does not mention potential side effects (likely none), error conditions, or output formatting beyond 'list of events', leaving some behavioral ambiguity.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a one-line purpose, followed by a compact Args list and a Returns line. Every parameter is covered in a single informative line, with no redundant exposition. It is appropriately sized for a tool with five parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (list events) and the absence of an output schema, the description adequately covers the core aspects: what it does, how to specify namespace and cluster, optional filters, and return type. It could be more detailed about event ordering or the exact structure of the returned list, but it is sufficient for a straightforward read operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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's Args section adds substantial meaning to every parameter: the special value 'all' for namespace, the precedence between kubeconfig_path and cluster_name, the purpose of event_type as a filter, and the role of limit. This completely compensates for the schema's lack of descriptions and provides actionable guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with '获取集群事件' (retrieve cluster events), which is a specific verb+resource combination that clearly indicates the tool's purpose. It is distinct from sibling tools like get_pod_logs or get_cluster_info, as 'cluster events' unambiguously refers to Kubernetes events.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on how to scope the query (e.g., namespace='all' for all namespaces) and explains the cluster selection precedence between kubeconfig_path and cluster_name. It does not explicitly mention alternatives, but the purpose is self-evident and the parameter guidance effectively implies when to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cluster_infoB
获取Kubernetes集群信息
Args: kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 集群信息
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explains parameter selection behavior (kubeconfig_path vs cluster_name) but does not state whether the operation is read-only, what exact information is returned, or potential side effects. The return value '集群信息' (cluster info) is vague.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with a clear summary, followed by structured Args and Returns sections. It is appropriately sized for a simple tool, with no wasted sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with 2 optional parameters and no output schema. The description covers the parameter selection logic but does not specify return fields or error conditions. It is minimally adequate but lacks detail to fully understand the tool's output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, yet the description compensates by explaining each parameter's semantics: kubeconfig_path is the config file path, and cluster_name is used when kubeconfig_path is not specified. This adds meaning beyond the schema's type/default information, though could be more detailed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '获取Kubernetes集群信息' (Get Kubernetes cluster info), which is a specific verb+resource pair. However, it does not distinguish this from sibling tools like get_cluster_resource_usage or check_cluster_health, which also relate to cluster information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It only explains the parameters, not the intended use case or scenario. There is no mention of when to prefer get_cluster_info over other cluster tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cluster_resource_usageA
获取集群资源使用情况
Args: namespace: Kubernetes命名空间,"all"表示所有命名空间,默认为"all" kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 集群资源使用情况报告。pod_resources 超过 50 条时会截断,返回 truncated 和 total_count 说明
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | all | |
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses one meaningful behavioral trait: pod_resources exceeding 50 entries will be truncated, returning truncated and total_count. However, it omits other behavioral details such as whether the operation requires special permissions, what happens on error, or whether it is strictly read-only beyond the 'get' connotation. There is no contradiction with annotations (none provided).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with clear Args and Returns sections. Every line earns its place, providing essential parameter explanations and return behavior without redundancy. It is appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description explains the return report and truncation behavior, which is helpful. It also fully documents parameters. However, it does not describe what the resource usage report includes (e.g., CPU, memory, pod-level metrics) or outline the report structure. Still, for a straightforward read-only tool with optional params, the provided context is largely sufficient for an agent to invoke and interpret basic results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero description coverage, but the description compensates thoroughly. It explains each parameter: namespace meaning and default, kubeconfig_path precedence, and cluster_name usage when kubeconfig_path is omitted. It also clarifies the relationship between cluster_name and kubeconfig_path, adding significant meaning beyond the schema's bare titles and defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '获取集群资源使用情况' (get cluster resource usage), specifying a specific verb and resource. It distinguishes from most siblings like get_pod_logs and get_cluster_info, but does not explicitly differentiate from batch_top_resources, which might also list resource usage. Therefore it lacks explicit sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or conditions. The description only explains parameters and return behavior, not usage context. It neither states exclusions nor alternative tool references.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_kubeconfig_infoA
获取 kubeconfig 文件详细信息或验证 kubeconfig 内容格式
两种用法:
传 name:读取已保存的 kubeconfig 并返回详情
传 content:验证传入的 kubeconfig 内容格式
Args: name: 已保存的配置名称(与 content 二选一) content: kubeconfig 文件内容(与 name 二选一,用于验证格式)
Returns: kubeconfig 详细信息或验证结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| content | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the burden of disclosing behavior. It explains the two operational modes (reading a saved config vs validating content) but does not explicitly state that the tool is read-only, what happens on errors, or any permissions required. The verbs imply non-mutating behavior, but this is not made explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, starting with a summary sentence, then listing the two usage modes, the arguments, and the return value. Every sentence adds value and there is no unnecessary verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description only vaguely states 'kubeconfig detailed information or validation result' without specifying the structure of the return value or error conditions. It adequately covers the two usage modes, but for a tool with no output schema, more detail on return format and failure handling would be expected.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description fully compensates by defining both parameters: 'name' as a saved configuration name for reading details, 'content' as kubeconfig file content for validation, and clearly stating they are mutually exclusive. This adds substantial meaning beyond the bare input schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves kubeconfig details or validates content format, using specific verbs ('获取' and '验证') and a resource ('kubeconfig'). It distinguishes two usage modes and differentiates from sibling tools like list/delete/load by focusing on info retrieval and validation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lays out two usage contexts: passing a saved name to get details, or passing content to validate format, and notes the parameters are mutually exclusive. It does not mention alternative tools or exclusions, but provides clear context for how to use the tool itself.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pod_logsA
获取Pod的日志
Args: name: Pod名称 namespace: Kubernetes命名空间,默认为default lines: 日志行数,默认为100 container: 容器名称,如果Pod有多个容器则需要指定 previous: 是否获取上一实例(崩溃/重启前)的日志,默认为False kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 包含Pod日志的结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| lines | No | ||
| previous | No | ||
| container | No | ||
| namespace | No | default | |
| cluster_name | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must disclose behavior on its own. It provides useful details about the 'previous' flag for pre-restart logs, default line count, and kubeconfig/cluster_name fallback logic. However, it does not mention permission requirements, error behavior, or what happens when a multi-container pod lacks a specified container.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a one-line summary, a coherent Args list, and a Returns section. It is appropriately sized for a tool with 7 parameters and avoids redundant filler, earning every sentence's place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and no annotations, so the description should clarify return value and edge cases. It says only '包含Pod日志的结果' without specifying format or content. Parameter guidance is strong, but behavioral boundaries such as errors or multi-container requirements are incomplete, leaving the description adequate but not fully comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description's Args section thoroughly explains all 7 parameters, including defaults and special cases like container needed for multi-container pods. It also clarifies the precedence relationship between kubeconfig_path and cluster_name, which the schema does not convey.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description begins with '获取Pod的日志', clearly stating the tool retrieves Pod logs. This specific verb+resource phrase unambiguously distinguishes it from sibling tools such as exec_pod_command or check_pod_health.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies its usage context—fetching pod logs—but does not explicitly state when to use it over alternatives, nor does it mention any exclusions or prerequisites. There is no 'when-not-to-use' guidance or reference to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
import_clusterB
导入集群配置。
kubeconfig 参数接受三种形式:
服务端文件路径(如 /app/data/.../xxx.yaml)
kubeconfig 完整文本内容(可直接传入,服务端会自动校验证书与私钥匹配)
用户提供的本地文件路径(服务端不可达时需先上传,见下方)
服务端会自动校验 client-certificate-data 与 client-key-data 是否匹配。 如果内容在传输过程中被损坏,校验会失败并返回包含 curl 上传指引的错误信息。
Args: name: 集群名称(仅允许字母、数字、点、下划线、连字符) kubeconfig: 服务端文件路径 或 kubeconfig 完整文本内容 service_account: 服务账户名称,默认为default namespace: 默认命名空间,默认为default is_default: 是否设为默认集群,默认为False
Returns: 导入结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| namespace | No | default | |
| is_default | No | ||
| kubeconfig | Yes | ||
| service_account | No | default |
TDQS
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.
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.
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.
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.
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.
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.
list_backupsA
列出备份文件(仅读取本地备份目录,无需 K8s 连接)
Args: cluster_name: 集群名称(可选) namespace: 命名空间(可选)
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | ||
| cluster_name | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the operation is read-only ('仅读取本地备份目录') and does not require K8s connection, which is key transparency for an agent. However, it does not detail filtering behavior or output format, so it is not fully transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded: it starts with the core purpose, adds a critical behavioral note, then lists the args. Every sentence adds value and there is no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no annotations or output schema, and the description omits important contextual details such as how the optional parameters filter the backup listing and what the return format looks like. This makes the description insufficient for an agent to fully understand the tool's behavior in a real interaction.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description should compensate. It only restates the parameter names (集群名称, 命名空间) and marks them optional, which the schema already indicates via defaults. It does not explain how cluster_name or namespace affect the backup listing, leaving the parameters semantically underspecified.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists backup files and adds the specific context that it only reads a local backup directory without requiring a K8s connection. This makes the tool's purpose unambiguous and distinguishes it from K8s-dependent sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for use: it is for listing backups locally without K8s connectivity. However, it does not explicitly mention when not to use it or name alternative tools, so it falls just short of full usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_clustersA
查看集群配置:不指定 name 时列出所有已导入集群,指定 name 时返回该集群详情
Args: name: 集群名称(可选)。省略则列出全部集群;指定则返回该集群的配置详情
Returns: 集群列表或单个集群配置
| Name | Required | Description | Default |
|---|---|---|---|
| name | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden; it indicates a read-only 'view' operation and clarifies the list-vs-detail response based on the name parameter. It does not disclose potential permission requirements, error conditions, or response structure beyond what is stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and front-loaded, but it repeats the conditional behavior in the main description and again in the Args section (e.g., '指定则返回该集群的配置详情' vs '指定则返回该集群详情'). Minor redundancy prevents a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description adequately covers behavior, parameters, and return type. It does not elaborate on pagination, authorization, or field details, but these are not expected for a basic list/detail operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description fully compensates by explaining the single name parameter: it is optional, omitting it lists all clusters, and specifying it returns cluster details. This adds critical meaning beyond the bare string/null schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a clear verb+resource ('查看集群配置') and specifies conditional behavior: omitting name lists all imported clusters, while specifying name returns cluster details. However, it does not explicitly differentiate from the sibling get_cluster_info, which may also return cluster details, so sibling distinction is incomplete.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear context on when to omit or specify the name parameter, effectively describing the two usage modes. It does not name alternatives or state when not to use this tool, so it falls short of explicit exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_kubeconfigsA
列出所有保存的kubeconfig文件
Returns: kubeconfig文件列表
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries full responsibility. It only states the basic listing action and that a list is returned, but does not disclose read-only nature, potential errors, requirements, or any side effects. The behavior is implied by 'list' but not explicitly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with a single action sentence, but the 'Returns' line 'kubeconfig文件列表' is redundant with the first sentence, slightly reducing efficiency. Still, it is front-loaded and appropriately sized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with no parameters and no output schema, the description is adequate. It specifies the resource scope ('all saved kubeconfig files') and return type, but could mention where the files are located or how they are referenced, though that is likely domain knowledge.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the input schema is empty, so schema coverage is trivially 100%. The baseline for 0 parameters is 4, and the description adds no parameter-related meaning because there are none to describe.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists all saved kubeconfig files, using a specific verb ('列出') and resource ('kubeconfig文件'). It distinguishes from siblings like load/delete/get_kubeconfig_info by focusing on listing all, not individual operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as load_kubeconfig or get_kubeconfig_info. The description simply states what it does without any contextual hints or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
load_kubeconfigB
加载kubeconfig文件
注意:kubeconfig 包含集群认证凭据(token、证书等),请勿在不可信环境中暴露。 可通过 mask_sensitive=True 脱敏 token、证书等敏感字段后再输出。
Args: name: 配置名称 mask_sensitive: 是否脱敏敏感字段(token、client-certificate-data、client-key-data),默认 False
Returns: kubeconfig文件内容
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| mask_sensitive | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the sensitive nature of the kubeconfig content and explains the mask_sensitive parameter behavior, which is helpful. However, it does not disclose other behavioral traits such as where the config is loaded from or potential errors.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-organized, with a warning note, argument explanations, and return value. Every sentence serves a purpose, and the structure is clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter tool, the description covers the main action, return value, and a critical safety note. However, it lacks details about output format (e.g., YAML/JSON) and error conditions, leaving some context missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only bare titles ('Name', 'Mask Sensitive'), and schema description coverage is 0%. The description compensates by explaining 'name' as configuration name and 'mask_sensitive' as masking token/certificate fields, adding real semantic value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool loads a kubeconfig file and specifies it returns the file content. It clearly identifies the action and resource, but does not explicitly differentiate from sibling tools like get_kubeconfig_info or list_kubeconfigs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention exclusions or prerequisites, making it unclear when to choose load_kubeconfig over list_kubeconfigs or get_kubeconfig_info.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
manage_nodeA
节点运维管理:排水(drain)、标记不可调度(cordon)、恢复调度(uncordon)
Args: node_name: 节点名称 action: 操作类型 - "drain":cordon + 驱逐 Pod(等同于 kubectl drain) - "cordon":仅标记不可调度,不驱逐现有 Pod(等同于 kubectl cordon) - "uncordon":恢复为可调度(等同于 kubectl uncordon) ignore_daemonset: drain 时是否跳过 DaemonSet Pod,默认 True ignore_mirror_pods: drain 时是否跳过 mirror pod(静态 Pod 镜像),默认 True kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: 操作结果
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | drain | |
| node_name | Yes | ||
| cluster_name | No | ||
| kubeconfig_path | No | ||
| ignore_daemonset | No | ||
| ignore_mirror_pods | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does disclose key side effects like drain evicting pods and default behavior for DaemonSet and mirror pods. It lacks details on permissions, reversibility, or potential cluster-level impact, which is important for a mutating Kubernetes tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear header and parameter list, and every parameter earns its place. The Returns section is vague, but overall the text is efficient and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 6 parameters and no output schema or annotations, the description covers all the essential parameter semantics and action behavior, making it usable. However, the return value is only described as '操作结果', and missing error/permission context leaves minor completeness gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description compensates thoroughly by explaining all six parameters, including action enum values with kubectl equivalents and the precedence between kubeconfig_path and cluster_name. This adds substantial meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as node operations management with three explicit actions (drain, cordon, uncordon), mapping them to kubectl equivalents. This distinguishes it from sibling tools focused on checking health or general resource management.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The action definitions imply when each operation is appropriate, such as using drain to evict pods or cordon to mark unschedulable. However, it doesn't explicitly state when to prefer this tool over alternatives like check_node_health or batch_update_resources, nor does it provide exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
port_forwardA
Pod 端口转发管理:启动、停止、列出转发会话
Args: action: 操作类型 - "start"(启动转发)、"stop"(停止转发)、"list"(列出当前转发) pod_name: start 时必填,Pod 名称 local_port: start 时必填,本地端口(1-65535) pod_port: start 时必填,Pod 端口(1-65535) namespace: Kubernetes 命名空间,默认 default forward_id: stop 时必填,要停止的转发会话 ID(由 start 返回或 list 查看) idle_timeout: start 时可选,空闲超时秒数(0=不超时)。超过此时间无连接活动则自动停止转发 kubeconfig_path: kubeconfig 文件路径 cluster_name: 集群配置名称
Returns: start: 转发会话信息(含 forward_id); stop: 停止确认; list: 所有活跃转发
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | start | |
| pod_name | No | ||
| pod_port | No | ||
| namespace | No | default | |
| forward_id | No | ||
| local_port | No | ||
| cluster_name | No | ||
| idle_timeout | No | ||
| kubeconfig_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the idle_timeout behavior (automatic stop after inactivity) and return values for each action. It does not elaborate on underlying network mechanics or prerequisites like kubeconfig validity, but it provides meaningful behavioral context beyond a bare function statement.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is organized with a one-line summary followed by an Args list and Returns section. It is somewhat long due to the 9 parameters, but every sentence adds value and the structure helps readability. It could be more concise, but the density is appropriate for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (9 parameters, no annotations, no output schema), the description is remarkably complete. It covers all parameters, describes the return values for each action, and explains conditional requirements and idle timeout behavior. No important usage aspect is left unexplained.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description is the only source of parameter meaning. It explains every parameter in detail, including conditional requirements (pod_name/local_port/pod_port required for start, forward_id for stop), defaults (namespace default 'default'), ranges (ports 1-65535), and idle_timeout semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Pod 端口转发管理:启动、停止、列出转发会话' (Pod port forwarding management: start, stop, list sessions). This specifies the verb (manage/start/stop/list) and resource (port forwarding), effectively distinguishing it from sibling tools like get_pod_logs or exec_pod_command.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for each action (start/stop/list) and the parameters required for each. It does not explicitly name alternative tools for port forwarding, but within the sibling set no other tool handles port forwarding. Therefore, it gives sufficient guidance on when to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
restore_from_backupC
从备份恢复资源
Args: backup_file: 备份文件路径 target_namespace: 目标命名空间(可选) target_cluster: 目标集群(可选) kubeconfig_path: kubeconfig 文件路径,不指定则使用默认集群
| Name | Required | Description | Default |
|---|---|---|---|
| backup_file | Yes | ||
| target_cluster | No | ||
| kubeconfig_path | No | ||
| target_namespace | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the full burden of behavioral disclosure. It only says 'restore from backup' with no mention of the operation's side effects (e.g., overwriting existing resources, needing cluster permissions, whether it is destructive) or any other traits. This is effectively no disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: a one-line summary followed by a clear Args list. Every line provides useful information without redundancy, and the front-loaded purpose makes the tool's intent immediately clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and no annotations, yet the description only covers the purpose and parameter meanings. It omits behavioral details like what happens during restore, whether it replaces existing resources, what errors might occur, and what the success/result indication is. Given the complexity of a restore operation, this is incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% because the schema properties have no descriptions. The description compensates with an Args block that explains each parameter: backup_file path, optional target_namespace, optional target_cluster, and kubeconfig_path with fallback to default cluster. This adds meaningful context beyond the schema's type/default info, though it could be more detailed about expected value formats.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Restore resources from backup' with a clear verb-object structure. It is distinct from the backup creation tools in the sibling list, though it could be more specific about what types of resources or what form the backup takes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is provided about when to use this tool versus alternatives. The existence of backup_namespace and backup_resource implies restore is the counterpart, but the description does not state prerequisites, exclusions, or when an alternative like backup_resource or list_backups might be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_default_clusterD
设置默认集群
Args: name: 集群名称
Returns: 设置结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations and no output schema, the description carries the full burden of explaining side effects. It fails to disclose what setting a default cluster means, whether it affects future operations, persists, or requires special permissions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short, but this is under-specification rather than effective conciseness. The Args/Returns sections are terse yet uninformative, adding little value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Even for a simple one-parameter tool, the description is incomplete. It does not explain the purpose of a 'default cluster', how the setting is used, or what a successful return looks like, leaving the agent with a tautological overview.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema's 'name' parameter has 0% description coverage, and the description only adds '集群名称' (cluster name), which adds essentially no semantic value beyond the parameter name itself. The description does not compensate for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '设置默认集群' is a direct translation of the tool name 'set_default_cluster', restating it without adding any specificity. It does not distinguish this tool from siblings beyond what the name already implies.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as import_cluster or list_clusters. There is no mention of prerequisites, context, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
test_cluster_connectionA
测试集群连接(会从磁盘重新加载 kubeconfig,确保使用最新凭据)
Args: name: 集群名称
Returns: 连接测试结果
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the significant behavior of reloading kubeconfig from disk, but does not mention side effects, authentication requirements, or what happens on failure. This is partial transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: a one-line purpose, an args section, and a returns section. Every sentence earns its place, and the structure is clear and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter test tool with no output schema, the description covers the essential purpose, behavior, argument, and return type. It does not elaborate on error cases, but given the simplicity and sibling context (e.g., check_cluster_health exists), it is reasonably complete and not under-specified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although the schema has no descriptions, the description explicitly lists 'name: 集群名称' (cluster name), providing meaning beyond the bare schema field. For a single parameter this is sufficient, but lacks deeper context like formats or defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'test cluster connection' with a specific verb and resource, and adds the unique behavior of reloading kubeconfig from disk. This distinguishes it from siblings like check_cluster_health or get_cluster_info.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage is for testing connectivity with fresh credentials by reloading kubeconfig. It gives clear context but does not explicitly name alternatives or exclusion criteria, earning a 4 rather than 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
32 tool updates
v1.0.0- First observed
backup_namespace - First observed
backup_resource - First observed
batch_create_resources - First observed
batch_delete_resources - First observed
batch_describe_resources - First observed
batch_list_resources - First observed
batch_restart_resources - First observed
batch_rollout_resources - First observed
batch_top_resources - First observed
batch_update_resources - First observed
check_cluster_health - First observed
check_node_health - First observed
check_pod_health - First observed
copy_pod_files - First observed
delete_cluster - First observed
delete_kubeconfig - First observed
exec_pod_command - First observed
get_cluster_events - First observed
get_cluster_info - First observed
get_cluster_resource_usage - First observed
get_kubeconfig_info - First observed
get_pod_logs - First observed
import_cluster - First observed
list_backups - First observed
list_clusters - First observed
list_kubeconfigs - First observed
load_kubeconfig - First observed
manage_node - First observed
port_forward - First observed
restore_from_backup - First observed
set_default_cluster - First observed
test_cluster_connection
TDQS
Scored across 32 tools
Most tools target distinct resources and actions, but there is notable potential confusion between cluster configuration management (list_clusters/import_cluster) and kubeconfig management (list_kubeconfigs/load_kubeconfig/get_kubeconfig_info), which serve similar purposes through different storage layers. get_cluster_info, check_cluster_health, and get_cluster_resource_usage also overlap somewhat as cluster-level inspection tools.
The set overwhelmingly follows a verb_noun snake_case pattern like list_clusters, delete_kubeconfig, backup_namespace, and batch_*_resources. Minor deviations exist such as manage_node and port_forward, which combine multiple actions behind a generic verb/noun, and batch_top_resources uses an unconventional noun-style verb, but overall the pattern is predictable.
With 32 tools, this is above the 25+ threshold that feels heavy for a single server. The tools cover several distinct domains—pod operations, batch resource management, cluster config, kubeconfig handling, health checks, and backups—which justifies some breadth, but the count is still excessive and likely to complicate tool selection.
The toolset covers broad Kubernetes lifecycle needs: CRUD via batch operations, pod interaction (logs, exec, copy, port-forward), node management, health checks, events, resource usage, cluster/kubeconfig administration, and backup/restore. Minor gaps exist such as lack of explicit label-selector filtering for list operations and no dedicated scale action, but these can be worked around with batch update/create operations.
Maintenance
Related MCP Connectors
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Kubernetes resources through natural language interfaces like Goose CLI, allowing users to get, read, and patch Kubernetes resources.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with multiple Kubernetes clusters simultaneously, providing comprehensive tools for cluster management, resource operations, and diagnostics across different environments.-
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to interact with Kubernetes clusters by translating natural language into kubectl and Helm operations. It allows users to query, manage, and diagnose Kubernetes resources and cluster states through a seamless integration.20Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server that enables natural language interaction with Kubernetes clusters, allowing management of pods, deployments, namespaces, and cluster resources through conversational queries or API endpoints.1MIT