Skip to main content
Glama

patch_resource

Destructive

Patch one existing Kubernetes resource using JSON Patch, merge, or strategic merge for precise field mutations like removing a dnsConfig or sidecar container. Prefer over apply_resource when you know the exact field to mutate.

Instructions

Patch one existing Kubernetes resource with JSON Patch, JSON Merge Patch, or strategic merge patch. Use this for precise field/list mutations such as removing a bad dnsConfig, hostPort, initContainers field, sidecar container, nodeSelector, or replacing one scalar value. Prefer this over apply_resource when you know the exact field to mutate and do not want to rewrite the full manifest or take broad server-side-apply ownership. For patch_type=json, patch must be an RFC 6902 JSON Patch array. For patch_type=merge, patch must be a JSON object. For patch_type=strategic, use a JSON object against built-in Kubernetes kinds when you need name-keyed list merging, such as editing one container. By default returns compact post-patch state and dry-run preview diffs; JSON Patch calls also include per-operation field checks. Set verify=false only when you need a terse write result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesresource kind, e.g. Deployment, Service, ConfigMap
groupNoAPI group when the kind is ambiguous, e.g. apps for Deployment or serving.knative.dev for Knative Service
namespaceNonamespace for namespaced resources; omit for cluster-scoped resources
nameYesresource name
patch_typeNojson (default, RFC 6902 JSON Patch array), merge (JSON Merge Patch object), or strategic (built-in Kubernetes kinds only)
patchYesJSON patch body. For patch_type=json, pass an array like [{"op":"remove","path":"/spec/template/spec/dnsConfig"}]. For merge/strategic, pass an object.
dry_runNovalidate and preview the server-side result without persisting changes
verifyNoreturn compact post-patch state; on dry_run return a preview diff. JSON Patch calls also include field checks. Default true; set false for a terse write result.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/skyhook-io/radar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server