Skip to main content
Glama

Set pod anti affinity

k8s_set_pod_anti_affinity

Configure pod anti-affinity rules for a Kubernetes pod in a namespace to control scheduling and prevent selected pods from co-locating on the same nodes.

Instructions

Set pod anti-affinity for a pod.

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": {
      "pod_name": "<pod_name>",
      "namespace": "<namespace>",
      "anti_affinity": "<anti_affinity>"
    },
    "name": "k8s_set_pod_anti_affinity"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextNoNamed context of the multi-context pool to run against (see cm_multi_context list_contexts); the default context if omitted.
pod_nameYes
namespaceYes
anti_affinityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.4.2

TDQS

C2/5.0
Behavior2/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 mutation profile is known without the description. The description adds nothing beyond that: it does not say whether the change patches a live pod (typically immutable) or its controller template, whether existing anti-affinity rules are replaced or merged, or whether the pod is recreated. Nothing here contradicts the annotations, but the description is empty of behavioral value.

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

Conciseness2/5

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

The single sentence is short but is under-specification rather than conciseness — it carries no front-loaded information an agent could act on. There is no wasted wording, but there is also no useful wording.

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?

For a mutating tool with a nested free-form required object and no output schema, the description should explain the anti_affinity payload and the effect of the change. Neither is present, leaving an agent unable to call the tool correctly without reverse-engineering the object from elsewhere.

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?

Schema coverage is only 25% — just the context parameter is documented, and pod_name/namespace are self-evident from their names. The critical anti_affinity parameter is an untyped free-form object (additionalProperties=true, nested), and the description says nothing about its expected shape, such as label selectors, topology keys, or required sub-fields. This is the one place the description could have compensated for the schema gap and it does not.

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

Purpose2/5

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

"Set pod anti-affinity for a pod" restates the tool name and title almost verbatim, adding only the word "pod" as the target. It does not distinguish this from the sibling k8s_set_node_affinity, nor does it say what setting anti-affinity actually changes in the workload spec.

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 when-to-use guidance, no mention of prerequisites, and no pointer to the node-affinity sibling for the contrasting case. The only usage signal an agent can infer comes from the tool name itself, not from the description.

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