Skip to main content
Glama

Get node affinity

k8s_get_node_affinity
Read-onlyIdempotent

Retrieves the node affinity rules for a Kubernetes pod in a specified namespace, helping you inspect scheduling constraints and placement preferences.

Instructions

Get node 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>"
    },
    "name": "k8s_get_node_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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.4.2

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and openWorld, so the safety profile is covered. The description adds nothing beyond them — no statement about what is returned, whether it fails for unscheduled pods, or permission requirements — so it contributes no behavioral context of its own.

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

Conciseness3/5

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

A single short sentence with zero filler, front-loaded with the action and resource. However, the terseness here reflects under-specification rather than disciplined economy — there is no second sentence earning its place because there is no second sentence at all.

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

Completeness3/5

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

With no output schema, the description should at least characterize the returned affinity structure, and it does not. Annotations partially cover the behavioral burden, but an agent still cannot tell what shape the result takes or how it differs from k8s_inspect_node.

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 description coverage is 33%: only the context parameter is documented in the schema, while pod_name and namespace carry bare type declarations. The description does not compensate, offering no notes on name/namespace format or scoping, even though these are the two required parameters.

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?

States a specific verb and resource ("Get node affinity") plus the scoping object (a pod), which cleanly separates it from the sibling k8s_set_node_affinity. It stops just short of 5 because "node affinity for a pod" is slightly ambiguous about whether it returns the pod's nodeSelector/affinity spec or node-level affinity labels.

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

Usage Guidelines3/5

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

The read-only framing is implied by "Get", which signals this is the inspection counterpart to k8s_set_node_affinity, but no explicit when-to-use guidance, prerequisites, or named alternative is given. An agent must infer all selection logic.

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