Skip to main content
Glama

patch_resource

Destructive

Patch Kubernetes resources using JSON Patch, Merge Patch, or strategic merge for precise field mutations such as removing fields or replacing scalar values.

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.
Behavior5/5

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

The description adds context beyond annotations: it mentions returning compact post-patch state, dry-run preview diffs, and per-operation field checks for JSON Patch. This aligns with destructiveHint=true and provides useful behavioral details.

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?

The description is a single paragraph but well-organized with specific details. It could be slightly more concise, but each sentence adds value.

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

Completeness5/5

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

Given 8 parameters, no output schema, and three patch types, the description is thorough. It covers usage context, return behavior, verification options, and examples, making it complete for agent use.

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

Parameters5/5

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

Despite 100% schema coverage, the description adds significant meaning: it explains the patch types, gives example patch bodies for each, and clarifies the verify parameter's behavior (default true, set false for terse result).

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

Purpose5/5

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

The description clearly states the verb 'patch' and the resource 'existing Kubernetes resource'. It distinguishes from sibling apply_resource by specifying when to prefer this tool, such as for precise field mutations without rewriting the full manifest.

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

Usage Guidelines5/5

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

The description explicitly says 'Prefer this over apply_resource when you know the exact field to mutate' and provides guidance on different patch types with examples (RFC 6902 JSON Patch array, JSON Merge Patch, strategic merge patch).

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

Install Server

Other Tools

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