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. Custom columns to display in table output. Accepts either kubectl custom-columns format (e.g., "NAME:.metadata.name,IMAGE:.spec.containers[*].image") or comma-separated field names (e.g., "metadata.name,spec.replicas"). 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / customColumns / description
      Previous value: -"Optional. 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."New value: +"Optional. Custom columns to display in table output. Accepts either kubectl custom-columns format (e.g., \"NAME:.metadata.name,IMAGE:.spec.containers[*].image\") or comma-separated field names (e.g., \"metadata.name,spec.replicas\"). When both custom_columns and output_format are specified, output_format is ignored."
    • removedInput schema / properties / customColumns / format
      Removed value: -"google-fieldmask"
    • removedInput schema / properties / customColumns / pattern
      Removed value: -"^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$"
  2. Added

TDQS

B3.2/5.0
Behavior2/5

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

Annotations already disclose readOnly, idempotent, and non-destructive behavior, and the description adds only the kubectl analogy and a claim that resources are returned in YAML format. That claim is contradicted by the input schema, which states the default outputFormat is table (YAML is only one enum option), making the behavioral guidance misleading.

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 short and front-loaded with the core operation and filter scope. The kubectl analogy is useful context, but the unsupported YAML-format claim keeps it from earning full marks.

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?

For a read-only getter with rich schema and output schema, the description covers the main purpose and filtering behavior. It is incomplete on how this tool relates to sibling tools and contains a misleading output-format statement, so it is only minimally adequate.

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 schema has 100% parameter description coverage and detailed enum explanations, so the description does not need to carry much parameter meaning. The description reinforces the main filters (type, name, namespace, label selectors) but omits fieldSelector and customColumns; this adds nothing beyond the 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 clearly states a specific operation ('Gets one or more Kubernetes resources from a cluster') and identifies the resource family and filtering dimensions. However, it does not explicitly differentiate the tool from sibling tools like describe_k8s_resource or get_k8s_logs; the analogy to 'kubectl get' supplies some distinction but not a stated one.

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 'similar to running kubectl get' analogy gives useful context for when the tool is appropriate, and the filter list hints at its scope. The description never says when to prefer this tool over siblings such as describe_k8s_resource or list_k8s_api_resources, nor does it mention exclusions or prerequisites such as cluster auth.

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.

Resources