Skip to main content
Glama

backup_resource

Back up the original YAML of a specified Kubernetes resource, including built-in or custom resources, to preserve exact configuration for restore or audit.

Instructions

备份指定资源的原样 YAML。支持内置资源和自定义资源。

Args: resource_type: 类型名、Kind 或复数名,如 deployment、Secret、mysqls resource_name: 资源名称 namespace: 命名空间 api_version: API 版本。同一 Kind 属于多个 API 组时必填,如 example.com/v1 cluster_name: 集群名称(可选) kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "resource_type": "<resource_type>",
      "resource_name": "<resource_name>",
      "namespace": "<namespace>"
    },
    "name": "backup_resource"
  }
}

Input Schema

NameRequiredDescriptionDefault
namespaceYes
api_versionNo
cluster_nameNo
resource_nameYes
resource_typeYes
kubeconfig_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.9
    • addedInput schema / properties / api_version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Api Version"
      +}
  2. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the important trait that the backup is a byte-faithful YAML copy and works for custom resources as well as built-ins, but it says nothing about where the backup is written, whether it overwrites an existing backup, or what the tool returns.

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

Conciseness4/5

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

A single front-loaded sentence establishing purpose, followed by a compact per-argument list. No filler or repeated schema restatement beyond the needed clarifications.

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

Completeness3/5

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

For a tool that produces an artifact, the definition covers inputs well but omits the outcome: storage location, naming, overwrite behavior, and the relationship to list_backups/restore_from_backup are all unstated, and there is no output schema to fill that gap.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it mostly does: it explains that resource_type accepts a type name, Kind, or plural form, that api_version is required when one Kind spans multiple API groups (with an example), and that kubeconfig_path falls back to cluster_name or the default cluster. Only namespace and resource_name are self-explanatory, and no parameter semantics are left undocumented.

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

Purpose4/5

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

States a specific verb and resource: backs up the specified resource's verbatim (原样) YAML, and notes it covers both built-in and custom resources. That distinguishes it from a generic write tool, but it does not name backup_namespace, which is the nearest sibling and the one an agent might confuse it with.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance. Nothing says how this differs from backup_namespace (namespace-scoped backup) or list_backups/restore_from_backup, so the agent must infer the choice from the parameter list alone.

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