Skip to main content
Glama

Patch resource

patch_resource
Destructive

Patch a Kubernetes resource with a strategic merge patch or JSON patch. Works on custom resources too - provide the Kind and api_version from the cluster snapshot CRD index. For non-core kinds the live resource is fetched first and the patch is rejected if it is ArgoCD-managed unless allow_bypass=true.

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": {
      "kind": "<kind>",
      "name": "<name>",
      "patch": "<patch>",
      "cluster_id": "<cluster_id>"
    },
    "name": "patch_resource"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYesResource kind (e.g., 'Deployment', 'ConfigMap'). For custom resources use the Kind from the cluster snapshot CRD index.
nameYesResource name to patch.
patchYesPatch content. Use a JSON object for patch_type 'strategic' or 'merge'. Use a JSON array of {op, path, value} entries (RFC 6902) for patch_type 'json'.
dry_runNoIf true, preview the change without executing it.
namespaceNoKubernetes namespace.
cluster_idYesAnkra cluster id (UUID) the call targets. Discover ids with list_clusters.
patch_typeNoType of patch operation. Strategic merge is not supported by custom resources; use 'merge' or 'json' for them. 'strategic' and 'merge' require patch to be an object; 'json' requires patch to be an array of {op, path, value} entries.strategic
api_versionNoAPI version (e.g., 'v1', 'apps/v1', or '<group>/<version>' for custom resources from the snapshot CRD index).v1
allow_bypassNoBypass the ArgoCD-managed-resource safety check. Set ONLY when the user explicitly asked to override ArgoCD (e.g. 'force', 'bypass argo'). The confirmation dialog still appears with an enhanced warning.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and readOnlyHint=false, so the safety profile is covered. The description still adds real behavioral value beyond them: for non-core kinds the live resource is fetched first and the patch is refused when the resource is ArgoCD-managed unless allow_bypass=true. It does not describe what the response looks like or what a dry_run preview 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?

Three short sentences, front-loaded with what the tool does and followed by the two behavioral caveats that matter (custom resources, ArgoCD guard). Dense and useful, with only minor redundancy against the schema text.

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

Completeness4/5

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

For a 9-parameter destructive tool with no output schema, the description covers the two hazards an agent most needs to know: custom-resource handling and the ArgoCD-managed rejection path. The remaining gap is what a successful patch or dry_run returns, which is a modest omission given annotations already flag the destructive nature.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter is already documented in the schema itself, including the patch/patch_type coupling and the allow_bypass guidance. The description adds the notion that kind and api_version should be sourced from the cluster snapshot CRD index for custom resources, but that is also echoed in the schema, so value over structured data is marginal.

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 names a specific verb and resource ('Patch a Kubernetes resource') and specifies the supported patch mechanisms (strategic merge / JSON patch), which lets an agent distinguish it from apply_manifest or canvas_patch. It does not explicitly name a sibling tool whose use case it is separated from, so it stops short of full differentiation.

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 context is implied rather than stated: it explains that custom resources are supported by supplying Kind and api_version from the CRD index, and that ArgoCD-managed resources are rejected unless allow_bypass is set. However there is no explicit 'use this instead of X when Y' guidance among the many adjacent write tools (apply_manifest, apply_cluster_manifest, canvas_patch, delete_resource).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.