Skip to main content
Glama

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.

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.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety bar is lower. The description still adds real operational context the annotations cannot: for non-core kinds the live resource is fetched first and the patch is rejected if the object is ArgoCD-managed unless allow_bypass=true. It doesn't describe the response or rollback characteristics, keeping it out of 5 territory.

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

Conciseness5/5

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

Three tight sentences with no filler; the core action and patch types are front-loaded, and the ArgoCD safety rule and allow_bypass escape hatch follow in priority order. Every sentence carries distinct information.

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 mutation with no output schema, the description covers the essentials agents need to call it correctly: supported patch types, custom-resource handling, and the ArgoCD gating rule. It omits any note on the shape of the result or dry-run behavior, but those are minor gaps given the schema breadth.

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, including patch_type semantics and the CRD-index provenance of kind/api_version. The description largely restates that guidance ('provide the Kind and api_version from the cluster snapshot CRD index'), so the baseline 3 for high-coverage schemas applies.

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 enumerates the supported patch strategies (strategic merge, JSON patch), which is far more informative than a generic 'modify resource'. It also flags custom-resource support, but never names a sibling such as apply_manifest or delete_resource to disambiguate the write-style choice, so it stops just short of 5.

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?

It gives conditional guidance for custom resources ('use merge or json') and for allow_bypass ('set ONLY when the user explicitly asked to override ArgoCD'), which implies when the bypass path is appropriate. However, it never states when to reach for patch_resource versus the many nearby write tools (apply_manifest, apply_cluster_manifest, delete_resource), so the when-to-use picture is only implied.

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.

Resources