Skip to main content
Glama

restore_from_backup

Write Kubernetes resources from a backup file: create missing objects, replace existing ones, and omit runtime metadata such as status, UID, and resourceVersion.

Instructions

按备份文件写回资源。不存在则创建,已存在则替换。不提交 status,以及 uid、resourceVersion、generation、creationTimestamp、managedFields、selfLink、deletionTimestamp、deletionGracePeriodSeconds。

Args: backup_file: 备份文件路径,必须位于备份目录内 target_namespace: 目标命名空间。指定时必须与资源 metadata.namespace 一致 target_cluster: 目标集群(可选) kubeconfig_path: kubeconfig 文件路径,不指定则使用 target_cluster 或默认集群

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": {
      "backup_file": "<backup_file>"
    },
    "name": "restore_from_backup"
  }
}

Input Schema

NameRequiredDescriptionDefault
backup_fileYes
target_clusterNo
kubeconfig_pathNo
target_namespaceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does disclose genuinely useful behavior — create-vs-replace semantics and the exact server-managed fields that are stripped (status, uid, resourceVersion, generation, managedFields, selfLink, deletion timestamps). However, it says nothing about required RBAC permissions, whether replacing an existing resource is destructive/irreversible, partial-failure behavior, or whether a dry run exists.

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?

Purpose and mutation semantics are front-loaded in the first two clauses, followed by a compact per-parameter list; the long list of stripped fields is dense but each entry is meaningful. Little redundancy, though the Args lines for target_cluster are thin relative to the space the field list consumes.

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 four-parameter mutating restore with no annotations and no output schema, the definition covers purpose, field handling, and parameter constraints, but leaves out error behavior, permission requirements, and whether the target namespace must already exist. An agent could call it correctly for the happy path but would be guessing about failure and authorization conditions.

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 coverage is 0% (all parameters have only titles), so the Args block does the real work: it constrains backup_file to the backup directory, requires target_namespace to match metadata.namespace, and defines the kubeconfig_path fallback precedence relative to target_cluster. The only weak spot is target_cluster, which is described merely as optional with no scope or format detail.

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

Purpose4/5

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

The description gives a specific verb and resource — write resources back from a backup file — and immediately states the create-or-replace branching, so the agent knows exactly what the call does. It never names its inverse siblings (backup_resource/backup_namespace), so the differentiation from other tools is implied rather than explicit.

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

Usage Guidelines3/5

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

Usage is implied by 'write back from a backup file', and 'replace if exists' signals a mutating restore, but there is no explicit when-to-use vs when-not, no prerequisite ordering (e.g. backup must be produced by list_backups/backup_resource first), and no guidance on choosing target_cluster vs kubeconfig_path beyond a one-line fallback note.

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