Skip to main content
Glama

patch_resource

Destructive

Patch existing Kubernetes resources with JSON Patch, JSON Merge Patch, or strategic merge patch for precise field mutations like removing or replacing specific 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
nameYesresource name
groupNoAPI group when the kind is ambiguous, e.g. apps for Deployment or serving.knative.dev for Knative Service
patchYesJSON patch body. For patch_type=json, pass an array like [{"op":"remove","path":"/spec/template/spec/dnsConfig"}]. For merge/strategic, pass an object.
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.
dry_runNovalidate and preview the server-side result without persisting changes
namespaceNonamespace for namespaced resources; omit for cluster-scoped resources
patch_typeNojson (default, RFC 6902 JSON Patch array), merge (JSON Merge Patch object), or strategic (built-in Kubernetes kinds only)
Behavior5/5

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

Annotations already include destructiveHint=true, but the description enriches this by explaining default return behavior ('compact post-patch state and dry-run preview diffs'), the effect of verify=false, and that JSON Patch calls include per-operation field checks. It also details the format requirements for each patch_type, adding significant transparency beyond the annotation.

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 dense but every sentence delivers useful information: usage context, patch type specifics, and return behavior. It is front-loaded with the core purpose, then branches into details. Slightly long, but no redundancy, so it earns a 4 rather than a 5.

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 the tool has 8 parameters, no output schema, and destructive annotations, the description covers the essential decision points: when to use it, how to choose patch_type, what the patch payload should look like, and what the response contains. It also mentions verify and dry_run behavior, making it complete for a complex tool.

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 description coverage is 100%, so the baseline is 3. However, the description adds meaning by providing concrete examples for json and merge patch types and clarifying how patch format relates to patch_type ('For patch_type=json, patch must be an RFC 6902 JSON Patch array'). This goes beyond the schema's generic descriptions.

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 opens with a specific verb and resource: 'Patch one existing Kubernetes resource with JSON Patch, JSON Merge Patch, or strategic merge patch.' It clearly distinguishes itself from the sibling apply_resource by naming it and explaining when patch_resource is preferred, which goes beyond a generic statement.

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 states when to use this tool ('Use this for precise field/list mutations') and when to prefer an alternative ('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'). This gives clear context and an exclusion.

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