Skip to main content
Glama

get_k8s_resource

Read-onlyIdempotent

Gets one or more Kubernetes resources from a cluster. Resources can be filtered by type, name, namespace, and label selectors. Returns the resources in YAML format. This is similar to running kubectl get.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional. The name of the resource to retrieve. If not specified, all resources of the given type are returned.
parentYesRequired. The cluster, which owns this collection of resources. Format: projects/{project}/locations/{location}/clusters/{cluster}
namespaceNoOptional. The namespace of the resource. If not specified, all namespaces are searched.
outputFormatNoOptional. The output format. One of: (table, wide, yaml, json). If not specified, defaults to table. When both custom_columns and output_format are specified, output_format is ignored.
resourceTypeYesRequired. The type of resource to retrieve. Kubernetes resource/kind name in singular form, lower case. e.g. "pod", "deployment", "service".
customColumnsNoOptional. The field mask to specify columns to display. Use a single "*" to get all fields. When both custom_columns and output_format are specified, output_format is ignored.
fieldSelectorNoOptional. A field selector to filter resources.
labelSelectorNoOptional. A label selector to filter resources.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNoErrors encountered during retrieval.
outputNoThe output of the command in the requested format. It may contain resources in YAML or JSON format, or a table in plain text, or errors.

TDQS

B3.4/5.0
Behavior2/5

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

The description claims 'Returns the resources in YAML format,' which conflicts with the schema's `outputFormat` parameter that defaults to table. This misleading statement could cause an agent to expect YAML output when the default is actually table. Annotations indicate readOnly and idempotent, but the return-format inaccuracy is a transparency failure. The `kubectl get` analogy is helpful but does not offset the incorrect format statement.

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 concise (four short sentences) and front-loaded with the core purpose. The analogy to `kubectl get` is useful, but the sentence about YAML format is redundant and inaccurate, reducing overall effectiveness. It could be tightened by removing the misleading format claim.

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?

Given the rich schema, output schema, and annotations, the description does not need to explain return values. However, it has a significant gap: the misleading YAML statement, which could confuse an agent about output format. It also doesn't mention the required `parent` cluster parameter or clarify that omitting `name` returns all resources of a type. Overall, it's minimally viable but incomplete.

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

Parameters3/5

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

The input schema has 100% description coverage with detailed parameter descriptions, so the baseline is 3. The description mentions filtering by 'type, name, namespace, and label selectors,' which maps to some parameters but omits others like `outputFormat`, `customColumns`, and `fieldSelector`. Since the schema already fully explains these, the description adds little extra semantic value.

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 clearly states the tool's function: 'Gets one or more Kubernetes resources from a cluster.' It mentions filtering and the analogy to `kubectl get`. However, it does not explicitly distinguish it from sibling tool `describe_k8s_resource`, which in kubectl would provide more detailed output. Thus it lacks full sibling differentiation.

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

Usage Guidelines4/5

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

The description provides clear context that this tool is for retrieving Kubernetes resources, and the analogy to `kubectl get` implies basic listing/filtering. However, it does not explicitly state when to prefer this tool over alternatives like `describe_k8s_resource` or `get_k8s_logs`, and it provides no exclusions or when-not-to-use guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools target distinct actions and resources, but a few pairs could confuse agents, such as get_cluster (GKE cluster details) vs get_k8s_cluster_info (kubectl cluster-info), or apply_k8s_manifest vs patch_k8s_resource. Overall, descriptions help clarify the differences.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in lowercase snake_case (e.g., create_cluster, list_node_pools, get_k8s_logs). There are no mixed conventions or unpredictable naming variations.

Tool Count4/5

With 23 tools, the server covers both GKE cluster management and in-cluster Kubernetes operations, which justifies the count. It is slightly on the heavier side but remains within a reasonable scope for such a broad domain.

Completeness3/5

The tool surface covers create, read, update, and list operations for clusters and node pools, but notably lacks delete_cluster and delete_node_pool. This leaves an obvious lifecycle gap that agents cannot work around without additional tooling.

Resources