Skip to main content
Glama

list_oke_node_pools

Retrieve node pool details from Oracle Cloud Infrastructure to monitor Kubernetes cluster resources, including node shapes, versions, and placement configurations.

Instructions

List all node pools in a compartment, optionally filtered by cluster.

Args:
    compartment_id: OCID of the compartment
    cluster_id: Optional OCID of the cluster to filter by

Returns:
    List of node pools with their details including:
    - Node shape and image information
    - Kubernetes version
    - Placement configuration (ADs, subnets)
    - Node count per subnet
    - Lifecycle state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartment_idYes
cluster_idNo

Implementation Reference

  • MCP tool registration for 'list_oke_node_pools' including decorator, input parameters (compartment_id required, cluster_id optional), docstring schema, and call to core handler.
    @mcp.tool(name="list_oke_node_pools")
    @mcp_tool_wrapper(
        start_msg="Listing node pools in compartment {compartment_id}...",
        error_prefix="Error listing node pools"
    )
    async def mcp_list_oke_node_pools(
        ctx: Context,
        compartment_id: str,
        cluster_id: Optional[str] = None
    ) -> List[Dict[str, Any]]:
        """
        List all node pools in a compartment, optionally filtered by cluster.
    
        Args:
            compartment_id: OCID of the compartment
            cluster_id: Optional OCID of the cluster to filter by
    
        Returns:
            List of node pools with their details including:
            - Node shape and image information
            - Kubernetes version
            - Placement configuration (ADs, subnets)
            - Node count per subnet
            - Lifecycle state
        """
        return list_node_pools(oci_clients["container_engine"], compartment_id, cluster_id)
  • Core implementation of listing OKE node pools using OCI ContainerEngineClient, paginates results, formats node pool details including config, placement, and metadata.
    def list_node_pools(container_engine_client: oci.container_engine.ContainerEngineClient,
                        compartment_id: str,
                        cluster_id: Optional[str] = None) -> List[Dict[str, Any]]:
        """
        List all node pools in a compartment, optionally filtered by cluster.
    
        Args:
            container_engine_client: OCI ContainerEngine client
            compartment_id: OCID of the compartment
            cluster_id: Optional OCID of the cluster to filter by
    
        Returns:
            List of node pools with their details
        """
        try:
            kwargs = {"compartment_id": compartment_id}
            if cluster_id:
                kwargs["cluster_id"] = cluster_id
    
            node_pools_response = oci.pagination.list_call_get_all_results(
                container_engine_client.list_node_pools,
                **kwargs
            )
    
            node_pools = []
            for np in node_pools_response.data:
                node_pools.append({
                    "id": np.id,
                    "name": np.name,
                    "compartment_id": np.compartment_id,
                    "cluster_id": np.cluster_id,
                    "lifecycle_state": np.lifecycle_state,
                    "lifecycle_details": np.lifecycle_details,
                    "kubernetes_version": np.kubernetes_version,
                    "node_image_name": np.node_image_name if hasattr(np, 'node_image_name') else None,
                    "node_shape": np.node_shape,
                    "quantity_per_subnet": np.quantity_per_subnet if hasattr(np, 'quantity_per_subnet') else None,
                    "subnet_ids": np.subnet_ids if hasattr(np, 'subnet_ids') else None,
                    "node_config_details": {
                        "size": np.node_config_details.size if np.node_config_details else None,
                        "placement_configs": [
                            {
                                "availability_domain": pc.availability_domain,
                                "subnet_id": pc.subnet_id,
                                "capacity_reservation_id": pc.capacity_reservation_id if hasattr(pc, 'capacity_reservation_id') else None,
                            }
                            for pc in np.node_config_details.placement_configs
                        ] if np.node_config_details and hasattr(np.node_config_details, 'placement_configs') and np.node_config_details.placement_configs else [],
                    } if hasattr(np, 'node_config_details') and np.node_config_details else None,
                    "time_created": str(np.time_created) if hasattr(np, 'time_created') and np.time_created else None,
                })
    
            logger.info(f"Found {len(node_pools)} node pools in compartment {compartment_id}" +
                       (f" for cluster {cluster_id}" if cluster_id else ""))
            return node_pools
    
        except Exception as e:
            logger.exception(f"Error listing node pools: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return format in detail, which is helpful, but lacks critical behavioral traits such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or error conditions. For a list operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is efficiently structured with a clear purpose statement upfront, followed by well-organized sections for Args and Returns. Every sentence adds value: the first defines the tool's scope, the Args section clarifies parameters, and the Returns section details output. There's no wasted verbiage or redundancy.

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 tool's moderate complexity (list operation with filtering), no annotations, no output schema, and low schema description coverage (0%), the description does a decent job but has notable gaps. It explains parameters and return format well, but lacks behavioral context (e.g., safety, pagination, errors). For a tool with no structured metadata, it's adequate but not fully comprehensive.

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

Parameters4/5

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

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains that 'compartment_id' is an 'OCID of the compartment' and 'cluster_id' is an 'Optional OCID of the cluster to filter by', providing crucial semantic context that the schema alone lacks. This effectively compensates for the schema's deficiency, though it doesn't cover all possible parameter nuances.

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?

The description clearly states the specific action ('List all node pools') and resource ('in a compartment'), with explicit scope ('optionally filtered by cluster'). It distinguishes from sibling tools like 'get_oke_node_pool' (singular retrieval) and 'list_oke_clusters' (different resource type), making the purpose unambiguous and well-differentiated.

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 for when to use this tool ('List all node pools in a compartment, optionally filtered by cluster'), which implicitly distinguishes it from tools like 'get_oke_node_pool' (for single node pool details). However, it doesn't explicitly state when NOT to use it or name specific alternatives beyond the filtering hint, missing full explicit guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jopsis/mcp-server-oci'

If you have feedback or need assistance with the MCP directory API, please join our Discord server