Skip to main content
Glama

List Cluster Namespaces

get_namespaces
Read-onlyIdempotent

Lists cluster namespaces with status and age, excluding system namespaces by default, to help you find valid namespace names before using namespace-scoped tools.

Instructions

List namespaces in a cluster along with their status and age, excluding system namespaces by default.

Returns cluster_id, count, and items for cluster_id. By default (include_system=False) hides configured system namespaces such as kube-system; set include_system=True to include control-plane and system namespaces.

Use to discover valid namespace names before calling namespace-scoped tools. Prefer get_namespace_resources once you already know the target namespace and want its pods, services, and configs.

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": {
      "cluster_id": "<cluster_id>"
    },
    "name": "get_namespaces"
  }
}

Input Schema

NameRequiredDescriptionDefault
cluster_idYesUnique KubeOrbit cluster identifier returned by `list_teams_and_clusters` (1-63 URL-safe chars, e.g. 'gke-prod-us', 'eks-staging').
include_systemNoWhen false (default), excludes configured system namespaces (e.g. kube-system, kube-public, kube-node-lease) to match the portal's default view. Set to true to include all system and control-plane namespaces.

Output Schema

NameRequiredDescriptionDefault
countNoTotal number of namespaces returned.
itemsNoNormalized namespace entries with name, status, labels, and age.
cluster_idNoCluster identifier queried.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.1
    • addedInput schema / properties / cluster_id / description
      Added value: +"Unique KubeOrbit cluster identifier returned by `list_teams_and_clusters` (1-63 URL-safe chars, e.g. 'gke-prod-us', 'eks-staging')."
    • addedInput schema / properties / cluster_id / maxLength
      Added value: +63
    • addedInput schema / properties / cluster_id / minLength
      Added value: +1
    • addedInput schema / properties / cluster_id / pattern
      Added value: +"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$"
    • addedInput schema / properties / include_system / description
      Added value: +"When false (default), excludes configured system namespaces (e.g. kube-system, kube-public, kube-node-lease) to match the portal's default view. Set to true to include all system and control-plane namespaces."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "cluster_id": {
      +      "default": "",
      +      "description": "Cluster identifier queried.",
      +      "title": "Cluster Id",
      +      "type": "string"
      +    },
      +    "count": {
      +      "default": 0,
      +      "description": "Total number of namespaces returned.",
      +      "title": "Count",
      +      "type": "integer"
      +    },
      +    "items": {
      +      "description": "Normalized namespace entries with name, status, labels, and age.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "title": "Items",
      +      "type": "array"
      +    }
      +  },
      +  "title": "NamespacesOutput",
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral context the annotations cannot: the default exclusion of configured system namespaces such as kube-system and what flipping include_system changes. It slightly over-reaches by restating the returned keys (cluster_id, count, items) that the existing output schema already defines.

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?

Front-loaded with the core action and the default-scope caveat, then usage guidance, so a reader can stop after sentence one. The middle paragraph wastes some space re-declaring the return shape despite an output schema, which is the only real redundancy.

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

Completeness5/5

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

For a two-parameter read-only listing tool, the definition covers default behavior, system-namespace override, and the sibling handoff. With full schema coverage, rich annotations, and an output schema, no decision-relevant information is missing.

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?

Schema description coverage is 100% and both parameters are documented in-schema, so the baseline is 3. The description explains the include_system default and its effect, but that duplicates the schema text rather than adding new meaning (no format, sizing, or edge-case guidance for cluster_id).

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

Purpose5/5

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

States a specific verb and resource ('List namespaces in a cluster') plus the returned attributes (status and age) and the default scoping rule. The sibling distinction is carried explicitly by the closing pointer to get_namespace_resources, so an agent can separate the discovery tool from the detail tool without opening either schema.

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

Usage Guidelines5/5

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

Gives a concrete when-to-use ('discover valid namespace names before calling namespace-scoped tools') and names the exact condition for switching to an alternative ('once you already know the target namespace and want its pods, services, and configs'). Nothing is left to inference about which namespace tool to pick.

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