Skip to main content
Glama

Patch resource

k8s_patch_resource

Patch Kubernetes resources by type and name using strategic, merge, or JSON patches, with namespace/context support and dynamic fallback for unknown kinds.

Instructions

Generic patch for any common Kubernetes resource kind.

Dispatches on resource_type to the correct centralized client and patch_namespaced_<x> / patch_<x> method; unknown kinds fall back to the dynamic client resolved by kind.

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": {
      "resource_type": "<resource_type>",
      "name": "<name>"
    },
    "name": "k8s_patch_resource"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
contextNoNamed context of the multi-context pool to run against (see cm_multi_context list_contexts); the default context if omitted.
namespaceNo
patch_bodyNo
patch_typeNostrategic
resource_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.4.2

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is covered by structured data. The description adds one genuine behavioral fact beyond that — unknown kinds fall back to the dynamic client resolved by kind — but the rest of the text describes internal client dispatch rather than agent-facing behavior. It says nothing about reversibility, permission requirements, or what a partial/merge patch does to unspecified fields.

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 the purpose before the dispatch detail. The second half leans on internal implementation vocabulary ('centralized client', 'patch_namespaced_<x>') that is low-value to an agent, but there is no padding or repetition.

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

Completeness2/5

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

This is a mutating, open-world tool with 6 parameters, 17% schema coverage, no output schema, and no documentation of patch semantics. For a patch operation where merge strategy and body shape determine the outcome, the description omits the information an agent most needs before invoking it.

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

Parameters2/5

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

With 6 parameters and schema description coverage at only 17%, the description must carry the parameter burden and does not. It explains that resource_type drives dispatch, but leaves patch_type (whose default 'strategic' implies very different merge semantics), patch_body structure, and namespace optionality entirely to an undocumented schema.

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 states a specific verb and resource scope: 'Generic patch for any common Kubernetes resource kind', and explains the dispatch on resource_type plus the dynamic-client fallback for unknown kinds. It is clear what the tool does, but it never distinguishes itself from near-siblings such as k8s_apply_manifest or the update tools, which an agent could easily confuse with patching.

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

Usage Guidelines2/5

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

There is no explicit statement of when to reach for patch versus apply_manifest, update_resource_quota, or label_resource, and no when-not guidance. The only implicit signal is the fallback note that unknown kinds are routed through the dynamic client, which implies broad applicability but does not route the agent between alternatives.

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

Deploy Server

Other Tools