Skip to main content
Glama

get_oke_cluster

Retrieve detailed configuration and status information for a specific Oracle Container Engine for Kubernetes (OKE) cluster, including network settings, Kubernetes version, endpoints, and add-ons.

Instructions

Get detailed information about a specific OKE cluster.

Args:
    cluster_id: OCID of the cluster

Returns:
    Detailed cluster information including:
    - Kubernetes version and available upgrades
    - Cluster endpoints (public/private)
    - Network configuration (VCN, subnets, CIDR blocks)
    - Add-ons configuration (dashboard, tiller)
    - Image policy settings
    - Cluster metadata and options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYes

Implementation Reference

  • MCP handler function for 'get_oke_cluster' tool. Applies wrapper for logging/error handling and delegates to helper get_cluster.
    @mcp.tool(name="get_oke_cluster")
    @mcp_tool_wrapper(
        start_msg="Getting details for OKE cluster {cluster_id}...",
        error_prefix="Error getting OKE cluster details"
    )
    async def mcp_get_oke_cluster(ctx: Context, cluster_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific OKE cluster.
    
        Args:
            cluster_id: OCID of the cluster
    
        Returns:
            Detailed cluster information including:
            - Kubernetes version and available upgrades
            - Cluster endpoints (public/private)
            - Network configuration (VCN, subnets, CIDR blocks)
            - Add-ons configuration (dashboard, tiller)
            - Image policy settings
            - Cluster metadata and options
        """
        return get_cluster(oci_clients["container_engine"], cluster_id)
  • Registers the get_oke_cluster tool using FastMCP @mcp.tool decorator.
    @mcp.tool(name="get_oke_cluster")
  • Helper function implementing the core logic to retrieve and format OKE cluster details using OCI ContainerEngineClient.
    def get_cluster(container_engine_client: oci.container_engine.ContainerEngineClient,
                    cluster_id: str) -> Dict[str, Any]:
        """
        Get details of a specific OKE cluster.
    
        Args:
            container_engine_client: OCI ContainerEngine client
            cluster_id: OCID of the cluster
    
        Returns:
            Details of the cluster
        """
        try:
            cluster = container_engine_client.get_cluster(cluster_id).data
    
            # Format endpoint config
            endpoint_config = None
            if cluster.endpoint_config:
                endpoint_config = {
                    "subnet_id": cluster.endpoint_config.subnet_id,
                    "nsg_ids": cluster.endpoint_config.nsg_ids,
                    "is_public_ip_enabled": cluster.endpoint_config.is_public_ip_enabled,
                }
    
            # Format endpoints
            endpoints = None
            if cluster.endpoints:
                endpoints = {
                    "kubernetes": cluster.endpoints.kubernetes if hasattr(cluster.endpoints, 'kubernetes') else None,
                    "public_endpoint": cluster.endpoints.public_endpoint if hasattr(cluster.endpoints, 'public_endpoint') else None,
                    "private_endpoint": cluster.endpoints.private_endpoint if hasattr(cluster.endpoints, 'private_endpoint') else None,
                    "vcn_hostname_endpoint": cluster.endpoints.vcn_hostname_endpoint if hasattr(cluster.endpoints, 'vcn_hostname_endpoint') else None,
                }
    
            # Format cluster metadata
            metadata = None
            if cluster.metadata:
                metadata = {
                    "time_created": str(cluster.metadata.time_created) if hasattr(cluster.metadata, 'time_created') and cluster.metadata.time_created else None,
                    "created_by_user_id": cluster.metadata.created_by_user_id if hasattr(cluster.metadata, 'created_by_user_id') else None,
                    "created_by_work_request_id": cluster.metadata.created_by_work_request_id if hasattr(cluster.metadata, 'created_by_work_request_id') else None,
                    "time_updated": str(cluster.metadata.time_updated) if hasattr(cluster.metadata, 'time_updated') and cluster.metadata.time_updated else None,
                    "updated_by_user_id": cluster.metadata.updated_by_user_id if hasattr(cluster.metadata, 'updated_by_user_id') else None,
                    "updated_by_work_request_id": cluster.metadata.updated_by_work_request_id if hasattr(cluster.metadata, 'updated_by_work_request_id') else None,
                }
    
            # Format options
            options = None
            if cluster.options:
                options = {
                    "service_lb_subnet_ids": cluster.options.service_lb_subnet_ids if hasattr(cluster.options, 'service_lb_subnet_ids') else None,
                    "kubernetes_network_config": {
                        "pods_cidr": cluster.options.kubernetes_network_config.pods_cidr if cluster.options.kubernetes_network_config else None,
                        "services_cidr": cluster.options.kubernetes_network_config.services_cidr if cluster.options.kubernetes_network_config else None,
                    } if hasattr(cluster.options, 'kubernetes_network_config') and cluster.options.kubernetes_network_config else None,
                    "add_ons": {
                        "is_kubernetes_dashboard_enabled": cluster.options.add_ons.is_kubernetes_dashboard_enabled if cluster.options.add_ons and hasattr(cluster.options.add_ons, 'is_kubernetes_dashboard_enabled') else None,
                        "is_tiller_enabled": cluster.options.add_ons.is_tiller_enabled if cluster.options.add_ons and hasattr(cluster.options.add_ons, 'is_tiller_enabled') else None,
                    } if hasattr(cluster.options, 'add_ons') and cluster.options.add_ons else None,
                    "admission_controller_options": {
                        "is_pod_security_policy_enabled": cluster.options.admission_controller_options.is_pod_security_policy_enabled if cluster.options.admission_controller_options and hasattr(cluster.options.admission_controller_options, 'is_pod_security_policy_enabled') else None,
                    } if hasattr(cluster.options, 'admission_controller_options') and cluster.options.admission_controller_options else None,
                    "persistent_volume_config": {
                        "defined_tags": cluster.options.persistent_volume_config.defined_tags if cluster.options.persistent_volume_config and hasattr(cluster.options.persistent_volume_config, 'defined_tags') else None,
                        "freeform_tags": cluster.options.persistent_volume_config.freeform_tags if cluster.options.persistent_volume_config and hasattr(cluster.options.persistent_volume_config, 'freeform_tags') else None,
                    } if hasattr(cluster.options, 'persistent_volume_config') and cluster.options.persistent_volume_config else None,
                    "service_lb_config": {
                        "defined_tags": cluster.options.service_lb_config.defined_tags if cluster.options.service_lb_config and hasattr(cluster.options.service_lb_config, 'defined_tags') else None,
                        "freeform_tags": cluster.options.service_lb_config.freeform_tags if cluster.options.service_lb_config and hasattr(cluster.options.service_lb_config, 'freeform_tags') else None,
                    } if hasattr(cluster.options, 'service_lb_config') and cluster.options.service_lb_config else None,
                }
    
            cluster_details = {
                "id": cluster.id,
                "name": cluster.name,
                "compartment_id": cluster.compartment_id,
                "lifecycle_state": cluster.lifecycle_state,
                "lifecycle_details": cluster.lifecycle_details,
                "vcn_id": cluster.vcn_id,
                "kubernetes_version": cluster.kubernetes_version,
                "time_created": str(cluster.time_created) if cluster.time_created else None,
                "time_updated": str(cluster.time_updated) if cluster.time_updated else None,
                "endpoint_config": endpoint_config,
                "endpoints": endpoints,
                "metadata": metadata,
                "options": options,
                "available_kubernetes_upgrades": cluster.available_kubernetes_upgrades if hasattr(cluster, 'available_kubernetes_upgrades') else None,
                "image_policy_config": {
                    "is_policy_enabled": cluster.image_policy_config.is_policy_enabled if cluster.image_policy_config and hasattr(cluster.image_policy_config, 'is_policy_enabled') else None,
                } if hasattr(cluster, 'image_policy_config') and cluster.image_policy_config else None,
                "cluster_pod_network_options": cluster.cluster_pod_network_options if hasattr(cluster, 'cluster_pod_network_options') else None,
                "type": cluster.type if hasattr(cluster, 'type') else None,
                "freeform_tags": cluster.freeform_tags if hasattr(cluster, 'freeform_tags') else None,
                "defined_tags": cluster.defined_tags if hasattr(cluster, 'defined_tags') else None,
            }
    
            logger.info(f"Retrieved details for OKE cluster {cluster_id}")
            return cluster_details
    
        except Exception as e:
            logger.exception(f"Error getting OKE cluster details: {e}")
            raise
Behavior3/5

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

With no annotations provided, the description carries the full burden. It implies a read-only operation ('Get detailed information'), which is consistent with typical 'get' tools, but does not disclose behavioral traits such as authentication requirements, rate limits, error conditions, or whether it's idempotent. It adds value by detailing the return content, but lacks operational context.

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 well-structured and front-loaded, starting with a clear purpose statement, followed by organized sections for Args and Returns. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is largely complete. It covers the purpose, parameter semantics, and detailed return information. However, it lacks output schema, so the return details are helpful but informal, and behavioral aspects like error handling are omitted, leaving minor gaps.

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 schema description coverage is 0%, so the description must compensate. It explicitly defines the single parameter 'cluster_id' as 'OCID of the cluster', adding crucial semantic meaning beyond the schema's generic 'Cluster Id' title. This clarifies the format and purpose of the parameter, effectively compensating for the low schema coverage.

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 ('Get detailed information') and target resource ('about a specific OKE cluster'), distinguishing it from sibling tools like 'list_oke_clusters' (which lists multiple clusters) and 'get_oke_cluster_kubeconfig' (which retrieves a specific configuration file). The purpose is precise and unambiguous.

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 implicitly suggests usage when detailed information about a specific cluster is needed, as opposed to listing clusters or getting other cluster-related data. However, it does not explicitly state when not to use it or name alternatives like 'list_oke_clusters' for overviews, leaving some room for improvement in 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